Skip to content

gh-115816: Improve internal symbols API in optimizer #116011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from

Conversation

gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Feb 27, 2024

@gvanrossum gvanrossum changed the title Change behavior of symbols and finish testing gh-115816: Improve internal symbols API in optimizer Feb 28, 2024
@gvanrossum gvanrossum marked this pull request as ready for review February 28, 2024 03:22
@gvanrossum
Copy link
Member Author

@Fidget-Spinner Do you have time to review?

@gvanrossum
Copy link
Member Author

FWIW the CI failure seems unrelated, it's homebrew being difficult (see #build channel on Discord).

gvanrossum and others added 4 commits February 27, 2024 19:36
In some cases we might cause a StreamWriter to stay alive even when the
application has dropped all references to it. This prevents us from
doing automatical cleanup, and complaining that the StreamWriter wasn't
properly closed.

Fortunately, the extra reference was never actually used for anything so
we can just drop it.
…hon#115667)

Nothing else in Python generally logs the contents of variables, so this
can be very unexpected for developers and could leak sensitive
information in to terminals and log files.
Demonstration:

>>> ast.FunctionDef.__annotations__
{'name': <class 'str'>, 'args': <class 'ast.arguments'>, 'body': list[ast.stmt], 'decorator_list': list[ast.expr], 'returns': ast.expr | None, 'type_comment': str | None, 'type_params': list[ast.type_param]}
>>> ast.FunctionDef()
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'name'. This will become an error in Python 3.15.
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'args'. This will become an error in Python 3.15.
<ast.FunctionDef object at 0x101959460>
>>> node = ast.FunctionDef(name="foo", args=ast.arguments())
>>> node.decorator_list
[]
>>> ast.FunctionDef(whatever="you want", name="x", args=ast.arguments())
<stdin>:1: DeprecationWarning: FunctionDef.__init__ got an unexpected keyword argument 'whatever'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
<ast.FunctionDef object at 0x1019581f0>
@Fidget-Spinner
Copy link
Member

I can review but it seems you messed up the merge.

@gvanrossum
Copy link
Member Author

Let me create a new PR.

@gvanrossum
Copy link
Member Author

See gh-116028 instead.

axizqayum686

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants