class TypedDictType(ProperType): (source)
Type of TypedDict object {'k1': v1, ..., 'kn': vn}. A TypedDict object is a dictionary with specific string (literal) keys. Each key has a value with a distinct type that depends on the key. TypedDict objects are normal dict objects at runtime. A TypedDictType can be either named or anonymous. If it's anonymous, its fallback will be typing_extensions._TypedDict (Instance). _TypedDict is a subclass of Mapping[str, object] and defines all non-mapping dict methods that TypedDict supports. Some dict methods are unsafe and not supported. _TypedDict isn't defined at runtime. If a TypedDict is named, its fallback will be an Instance of the named type (ex: "Point") whose TypeInfo has a typeddict_type that is anonymous. This is similar to how named tuples work. TODO: The fallback structure is perhaps overly complicated.
Class Method | deserialize |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | accept |
Undocumented |
Method | as |
Undocumented |
Method | copy |
Undocumented |
Method | create |
Undocumented |
Method | is |
Undocumented |
Method | names |
Undocumented |
Method | serialize |
Undocumented |
Method | zip |
Undocumented |
Method | zipall |
Undocumented |
Class Variable | __slots__ |
Undocumented |
Instance Variable | can |
Undocumented |
Instance Variable | can |
Undocumented |
Instance Variable | fallback |
Undocumented |
Instance Variable | items |
Undocumented |
Instance Variable | required |
Undocumented |
Property | is |
Undocumented |
Inherited from Type
(via ProperType
):
Method | __repr__ |
Undocumented |
Method | can |
Undocumented |
Method | can |
Undocumented |
Method | can |
Undocumented |
Method | can |
Undocumented |
Method | is |
Undocumented |
Instance Variable | _can |
Undocumented |
Instance Variable | _can |
Undocumented |
Inherited from Context
(via ProperType
, Type
):
Method | set |
If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node. |
Instance Variable | column |
Undocumented |
Instance Variable | end |
Undocumented |
Instance Variable | end |
Undocumented |
Instance Variable | line |
Undocumented |
dict[ str, Type]
, required_keys: set[ str]
, fallback: Instance
, line: int
= -1, column: int
= -1):
(source)
¶
mypy.types.Type.__init__
Undocumented
Instance|None
= None, item_types: list[ Type]|None
= None, required_keys: set[ str]|None
= None) -> TypedDictType
:
(source)
¶
Undocumented