Sorry, something went wrong.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
As I see at this point:
|
Sorry, something went wrong.
|
|
||
| arg = self.__forward_arg__ | ||
| if arg.isidentifier() and not keyword.iskeyword(arg): | ||
| if self.__forward_module__ is not None: |
There was a problem hiding this comment.
I don't think this is correct, since we infer globals from __forward_module__ if no explicit globals are given. And if explicit globals are given, we shouldn't be using __forward_module__.
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think current behavior is correct. Was there any discussion?
Sorry, something went wrong.
| # Return the text of the line in the body of __init__ that will | ||
| # initialize this field. | ||
|
|
||
| if f.init and isinstance(f.type, str): |
There was a problem hiding this comment.
Something like this is good, but I'd do it like this:
ForwardRef now lives in annotationlib, not typing. There's no need to catch SyntaxError as it doesn't parse its input in the constructor.
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
Fixes for #89687
Based on original #29158