You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
494 B
19 lines
494 B
2 years ago
|
"""Used to test `get_type_hints()` on a cross-module inherited `TypedDict` class
|
||
|
|
||
|
This script uses future annotations to postpone a type that won't be available
|
||
|
on the module inheriting from to `Foo`. The subclass in the other module should
|
||
|
look something like this:
|
||
|
|
||
|
class Bar(_typed_dict_helper.Foo, total=False):
|
||
|
b: int
|
||
|
"""
|
||
|
|
||
|
from __future__ import annotations
|
||
|
|
||
|
from typing import Optional, TypedDict
|
||
|
|
||
|
OptionalIntType = Optional[int]
|
||
|
|
||
|
class Foo(TypedDict):
|
||
|
a: OptionalIntType
|