Comments (3)
@AlexWaygood the changes you made didn't look related to the test failure @befeleme pointed out here. Do you know what's going on here?
The test failure @befeleme pointed out was more than a test failure: the test module was failing at import time. The failure was because the __default__
attribute on typing.TypeVar
is read-only on py313+: in our implementation of PEP-696, we were creating instances of typing.TypeVar
, then trying to monkeypatch __default__
attributes onto the TypeVar
instances after creating them. But it's unnecessary to monkeypatch attributes onto instances of TypeVar
on Python 3.13+, because the "real" TypeVar
implementation has a default
parameter for its constructor on Python 3.13+. So I fixed the error in #378 by simply not independently reimplementing TypeVar
at all on Python 3.13+; instead, we now just from typing import TypeVar
on Python 3.13+.
from typing_extensions.
#378 fixed all but one test failure. The last remaining one is to do with AsyncContextManager
having an optional second parameter on Python 3.13, but not in the backported version that typing_extensions
provides.
from typing_extensions.
@AlexWaygood the changes you made didn't look related to the test failure @befeleme pointed out here. Do you know what's going on here?
Also, there's another failure incoming due to changes I made for beta 2:
% ~/py/cpython/python.exe test_typing_extensions.py
Traceback (most recent call last):
File "/Users/jelle/py/typing_extensions/src/test_typing_extensions.py", line 42, in <module>
from _typed_dict_test_helper import Foo, FooGeneric, VeryAnnotated
File "/Users/jelle/py/typing_extensions/src/_typed_dict_test_helper.py", line 17, in <module>
class FooGeneric(TypedDict, Generic[T]):
~~~~~~~^^^
File "/Users/jelle/py/cpython/Lib/typing.py", line 431, in inner
return func(*args, **kwds)
File "/Users/jelle/py/cpython/Lib/typing.py", line 1243, in _generic_class_getitem
return _GenericAlias(cls, args)
File "/Users/jelle/py/cpython/Lib/typing.py", line 1420, in __init__
self.__parameters__ = _collect_parameters(
~~~~~~~~~~~~~~~~~~~^
args,
^^^^^
enforce_default_ordering=enforce_default_ordering,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
TypeError: _collect_parameters() got an unexpected keyword argument 'enforce_default_ordering'
Will work on a fix for that one.
from typing_extensions.
Related Issues (20)
- PEP-696: `AttributeError: attribute '__default__' of 'typing.ParamSpec' objects is not writable` on Python 3.13 HOT 4
- ParamSpec `_set_default` called from `ParamSpec.__new__` raises Attribute Error HOT 2
- Add an `override` decorator to a .pyi file HOT 8
- Add `inspect.get_annotations` backport
- Add `typing.get_type_hints` backport HOT 1
- Pylint raises error saying "default" isn't valid for TypeVar HOT 2
- Third-party tests failed on Sat Jun 01 2024 HOT 2
- `TypeError` on nested `Annotated`s with `typing_extensions==4.12.0`
- Third-party tests failed on Sun Jun 02 2024 HOT 2
- 4.12.1: `pyupgrade --py38-plus` generated patch causes pytest fails HOT 9
- Third-party tests failed on Mon Jun 03 2024 HOT 1
- Third-party tests failed on Thu Jun 06 2024 HOT 1
- Weird conflict between typing-extensions 4.12.1, xarray, dirty_equals on Python 3.8 HOT 2
- 4.12.2 creates an import bug HOT 2
- Add `typing_extensions.TypeExpr` HOT 4
- Third-party tests failed on Wed Jun 26 2024 HOT 1
- Third-party tests failed on Sat Jul 13 2024 HOT 1
- Third-party tests failed on Sun Jul 14 2024 HOT 3
- Third-party tests failed on Mon Jul 15 2024 HOT 1
- Third-party tests failed on Thu Jul 25 2024 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typing_extensions.