mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 10:51:15 +08:00
add typing._Final (#13015)
This is the subset of typing module internal base classes that are stable over all supported versions of python.
This commit is contained in:
@@ -133,6 +133,8 @@ if sys.version_info >= (3, 13):
|
||||
|
||||
Any = object()
|
||||
|
||||
class _Final: ...
|
||||
|
||||
def final(f: _T) -> _T: ...
|
||||
@final
|
||||
class TypeVar:
|
||||
@@ -191,7 +193,7 @@ _promote = object()
|
||||
|
||||
# N.B. Keep this definition in sync with typing_extensions._SpecialForm
|
||||
@final
|
||||
class _SpecialForm:
|
||||
class _SpecialForm(_Final):
|
||||
def __getitem__(self, parameters: Any) -> object: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
@@ -973,7 +975,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
|
||||
def __ior__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... # type: ignore[misc]
|
||||
|
||||
@final
|
||||
class ForwardRef:
|
||||
class ForwardRef(_Final):
|
||||
__forward_arg__: str
|
||||
__forward_code__: CodeType
|
||||
__forward_evaluated__: bool
|
||||
|
||||
Reference in New Issue
Block a user