8000 Copy-edit and add test (#541) · python/typing_extensions@478b2b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 478b2b3

Browse files
Copy-edit and add test (#541)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent 3c66d26 commit 478b2b3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Bugfixes and changed features:
3939
- Backport CPython PR [#124795](https://github.com/python/cpython/pull/124795):
4040
fix `TypeAliasType` not raising an error on non-tuple inputs for `type_params`.
4141
Patch by [Daraan](https://github.com/Daraan).
42-
- Fix that lists and ... could not be used for parameter expressions for `TypeAliasType`
42+
- Fix that lists and `...` could not be used for parameter expressions for `TypeAliasType`
4343
instances before Python 3.11.
4444
Patch by [Daraan](https://github.com/Daraan).
4545
- Fix error on Python 3.10 when using `typing.Concatenate` and
@@ -48,9 +48,9 @@ Bugfixes and changed features:
4848
to reflect Python 3.13+ behavior: A value assigned to `__total__` in the class body of a
4949
`TypedDict` will be overwritten by the `total` argument of the `TypedDict` constructor.
5050
Patch by [Daraan](https://github.com/Daraan), backporting a CPython PR by Jelle Zijlstra.
51-
- Fix for Python 3.11 that now `isinstance(typing_extensions.Unpack[...], TypeVar)`
52-
evaluates to `False`, however still `True` for <3.11.
53-
Patch by [Daraan](https://github.com/Daraan)
51+
- `isinstance(typing_extensions.Unpack[...], TypeVar)` now evaluates to `False` on Python 3.11
52+
and newer, but remains `True` on versions before 3.11.
53+
Patch by [Daraan](https://github.com/Daraan).
5454

5555
# Release 4.12.2 (June 7, 2024)
5656

src/test_typing_extensions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5045,6 +5045,14 @@ def test_backwards_compatibility(self):
50455045
self.assertIs(TD.__extra_items__, NoExtraItems)
50465046
self.assertEqual(TD.__annotations__, {"extra_items": int})
50475047

5048+
def test_cannot_combine_closed_and_extra_items(self):
5049+
with self.assertRaisesRegex(
5050+
TypeError,
5051+
"Cannot combine closed=True and extra_items"
5052+
):
5053+
class TD(TypedDict, closed=True, extra_items=range):
5054+
x: str
5055+
50485056

50495057
class AnnotatedTests(BaseTestCase):
50505058

0 commit comments

Comments
 (0)
0