| 1 |
From: Michael R. Crusoe <[email protected]> |
| 2 |
Subject: skip introspecting __annotations__ on Python 3.14+ |
| 3 |
|
| 4 |
PEP 649 changed how __annotations__ works, and mypy-extensions has yet to |
| 5 |
update to match. It might not update, as mypy_extensions.TypedDict is deprecated |
| 6 |
in favor of typing.TypedDict (in Python stdlib since 3.8) or |
| 7 |
typing_extensions.TypedDict (from version 4.3+; version 4.13 with support for |
| 8 |
PEP 728 (from Python 3.15) is already in Debian Trixie). |
| 9 |
|
| 10 |
See https://github.com/python/mypy_extensions/issues/65 |
| 11 |
|
| 12 |
--- python-mypy-extensions.orig/tests/testextensions.py |
| 13 |
+++ python-mypy-extensions/tests/testextensions.py |
| 14 |
@@ -102,7 +102,8 @@ |
| 15 |
def test_py36_class_syntax_usage(self): |
| 16 |
self.assertEqual(LabelPoint2D.__name__, 'LabelPoint2D') # noqa |
| 17 |
self.assertEqual(LabelPoint2D.__module__, __name__) # noqa |
| 18 |
- self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) # noqa |
| 19 |
+ if sys.version_info < (3, 14): |
| 20 |
+ self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) # noqa |
| 21 |
self.assertEqual(LabelPoint2D.__bases__, (dict,)) # noqa |
| 22 |
self.assertEqual(LabelPoint2D.__total__, True) # noqa |
| 23 |
self.assertNotIsSubclass(LabelPoint2D, typing.Sequence) # noqa |