python / typing_extensions

Backported and experimental type hints for Python
Other
446 stars 110 forks source link

PEP-696: `AttributeError: attribute '__default__' of 'typing.ParamSpec' objects is not writable` on Python 3.13 #404

Closed Zac-HD closed 6 months ago

Zac-HD commented 6 months ago

On Python 3.13.0b1, with typing-extensions 4.11.0 (latest at time of writing), I get an error:

Traceback (most recent call last):
    ...
    File "hypothesis/hypothesis-python/tests/typing_extensions/test_backported_types.py", line 187, in test_callable_with_paramspec
      P = ParamSpec("P")
    File "python3.13/site-packages/typing_extensions.py", line 1512, in __new__
      _set_default(paramspec, default)
    File "python3.13/site-packages/typing_extensions.py", line 1375, in _set_default
      type_param.__default__ = None
  AttributeError: attribute '__default__' of 'typing.ParamSpec' objects is not writable

This looks like a bug, maybe related to https://github.com/python/typing_extensions/issues/396.

AlexWaygood commented 6 months ago

This should be already fixed in 4.12.0rc1! Could you try that and see if you get any errors? I think we're planning on cutting the release properly tomorrow if there are no bugs reported from people testing the release candidate

AlexWaygood commented 6 months ago

(This is a duplicate of #377 ;)

JelleZijlstra commented 6 months ago

This should be already fixed in 4.12.0rc1! Could you try that and see if you get any errors? I think we're planning on cutting the release properly tomorrow if there are no bugs reported from people testing the release candidate

The new release should come out on Thursday, so a few more days than tomorrow.

Zac-HD commented 6 months ago

Happy to confirm that the release candidate solves my issue. Thanks all!