Skip to content

Commit 7676cd7

Browse files
committed
Do not support tuple
1 parent 27e8a5d commit 7676cd7

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/test_typing_extensions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,10 +5084,6 @@ def test_inline_empty(self):
50845084
TD = TypedDict[{}]
50855085
self.assertEqual(TD.__required_keys__, set())
50865086

5087-
def test_inline_argument_as_tuple(self):
5088-
TD = TypedDict[({},)]
5089-
self.assertEqual(TD.__required_keys__, set())
5090-
50915087
def test_inline(self):
50925088
TD = TypedDict[{
50935089
"a": int,

src/typing_extensions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,16 +1206,14 @@ class Point2D(TypedDict):
12061206
See PEP 655 for more details on Required and NotRequired.
12071207
"""
12081208
# This runs when creating inline TypedDicts:
1209-
if not isinstance(args, tuple):
1210-
args = (args,)
1211-
if len(args) != 1 or not isinstance(args[0], dict):
1209+
if not isinstance(args, dict):
12121210
raise TypeError(
12131211
"TypedDict[...] should be used with a single dict argument"
12141212
)
12151213

12161214
return _create_typeddict(
12171215
"<inline TypedDict>",
1218-
args[0],
1216+
args,
12191217
typing_is_inline=True,
12201218
total=True,
12211219
closed=None,

0 commit comments

Comments
 (0)