mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-04 19:28:50 +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:
1 parent
dfbbf168c9
commit
7c7629d909
3 files changed
+9
-3
No files matched your search
+4
-2
@@ -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