GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — Fix tests on Python 3.12 by JelleZijlstra · Pull Request #162 · python/typing_extensions Conversation
Member
On current Python main, TypeVar cannot be subclassed. However, we still need to enhance TypeVar to add the Also fix a few other minor test failures on current CPython main.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
AlexWaygood
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code looks good! A few comments about the tests. The only big concern I have is about Feels like we could probably share more code between
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
AlexWaygood
reviewed
Uh oh!
There was an error while loading. Please reload this page. Co-authored-by: Alex Waygood <[email protected]>
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
AlexWaygood
approved these changes
|
| class Foo[T](Protocol): | |
| def meth(self, x: T) -> None: ... |
(See https://github.com/python/typing_extensions/actions/runs/5029362366/jobs/9020946297?pr=162)
So I suppose we could possibly make this sys.version_info check more fine-grained:
typing_extensions/src/test_typing_extensions.py
Line 2399 in 40dbc09
| if sys.version_info >= (3, 12): |
But also, the beta is about to be released, so maybe it doesn't matter too much?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! I'll push something to make it check for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This brings in a fix for python 3.12: python/typing_extensions#162
With earlier versions of typing_extensions, the following traceback is
seen:
```
Traceback (most recent call last):
File ".../bin/mypy", line 5, in <module>
from mypy.__main__ import console_entry
File ".../lib/python3.12/site-packages/mypy/__main__.py", line 9, in <module>
from mypy.main import main, process_options
File ".../lib/python3.12/site-packages/mypy/main.py", line 12, in <module>
from typing_extensions import Final
File ".../lib/python3.12/site-packages/typing_extensions.py", line 1174, in <module>
class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
```
The error is addressed in typing_extensions in
python/typing_extensions#162, which is included
in the 4.6.0 release.
…n#17312) With earlier versions of typing_extensions, the following traceback is seen: ``` Traceback (most recent call last): File ".../bin/mypy", line 5, in <module> from mypy.__main__ import console_entry File ".../lib/python3.12/site-packages/mypy/__main__.py", line 9, in <module> from mypy.main import main, process_options File ".../lib/python3.12/site-packages/mypy/main.py", line 12, in <module> from typing_extensions import Final File ".../lib/python3.12/site-packages/typing_extensions.py", line 1174, in <module> class TypeVar(typing.TypeVar, _DefaultMixin, _root=True): TypeError: type 'typing.TypeVar' is not an acceptable base type ``` The error is addressed in typing_extensions in python/typing_extensions#162, which is included in the 4.6.0 release.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.