Debian Codegraph @

src/_typed_dict_test_helper.py

raw
1 from __future__ import annotations
2
3 from typing import Generic, Optional, T
4
5 from typing_extensions import Annotated, Required, TypedDict
6
7
8 # this class must not be imported into test_typing_extensions.py at top level, otherwise
9 # the test_get_type_hints_cross_module_subclass test will pass for the wrong reason
10 class _DoNotImport:
11 pass
12
13
14 class Foo(TypedDict):
15 a: _DoNotImport
16
17
18 class FooGeneric(TypedDict, Generic[T]):
19 a: Optional[T]
20
21
22 class VeryAnnotated(TypedDict, total=False):
23 a: Annotated[Annotated[Annotated[Required[int], "a"], "b"], "c"]