Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 138
Ensure isinstance is unaffected by sys.setprofile for Concatenate[] and Unpack[] aliases; run PyPy tests under coverage#668
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
4e955b971b62ca7b5c54d6f51d63af837bec161d4004d7e20bb8a5bcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1986,7 +1986,9 @@ class _ConcatenateGenericAlias(list): | ||
| __class__ = typing._GenericAlias | ||
| def __init__(self, origin, args): | ||
| super().__init__(args) | ||
| # Cannot use `super().__init__` here because of the `__class__` assignment | ||
| # in the class body (https://github.com/python/typing_extensions/issues/661) | ||
| list.__init__(self, args) | ||
brianschubert marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| self.__origin__ = origin | ||
| self.__args__ = args | ||
| @@ -2545,7 +2547,10 @@ def __typing_is_unpacked_typevartuple__(self): | ||
| def __getitem__(self, args): | ||
| if self.__typing_is_unpacked_typevartuple__: | ||
| return args | ||
| return super().__getitem__(args) | ||
| # Cannot use `super().__getitem__` here because of the `__class__` assignment | ||
| # in the class body on Python <=3.11 | ||
| # (https://github.com/python/typing_extensions/issues/661) | ||
| return typing._GenericAlias.__getitem__(self, args) | ||
brianschubert marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @_UnpackSpecialForm | ||
| def Unpack(self, parameters): | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curiously, if the trace function accesses
f_locals, e.g.then the test fails on Python 3.12.0 (and only this version) with this odd error:
/home/runner/work/typing_extensions/typing_extensions/src/typing_extensions.py:4303: RuntimeWarning: assigning None to unbound local 'name' {name: getattr(typing, name) for name in _typing_names if hasattr(typing, name)} Traceback (most recent call last): File "<string>", line 13, in <module> File "<string>", line 9, in run File "/home/runner/work/typing_extensions/typing_extensions/src/typing_extensions.py", line 4303, in <module> {name: getattr(typing, name) for name in _typing_names ifhasattr(typing, name)} ^^^^^^^^^^^^^^^^^^^^^TypeError: attribute name must be string, not 'NoneType'https://github.com/brianschubert/typing_extensions/actions/runs/17386017836/job/49352484071?pr=5
Note that it only fails on the 3.12.0 tests, not the 3.12 tests (which pass).
The same is true for the existing test in
ParamSpecTeststhat these tests were based on.