mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
Add @final to several more stdlib classes (#7215)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import SupportsRead
|
||||
from typing import IO, Any, NamedTuple, Union, overload
|
||||
from typing_extensions import final
|
||||
|
||||
if sys.platform != "win32":
|
||||
_chtype = Union[str, bytes, int]
|
||||
@@ -374,6 +375,7 @@ if sys.platform != "win32":
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
@final
|
||||
class _CursesWindow:
|
||||
encoding: str
|
||||
@overload
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from types import CodeType
|
||||
from typing import Any, Sequence
|
||||
from typing_extensions import final
|
||||
|
||||
def expr(source: str) -> STType: ...
|
||||
def suite(source: str) -> STType: ...
|
||||
@@ -14,6 +15,7 @@ def issuite(st: STType) -> bool: ...
|
||||
|
||||
class ParserError(Exception): ...
|
||||
|
||||
@final
|
||||
class STType:
|
||||
def compile(self, filename: StrOrBytesPath = ...) -> CodeType: ...
|
||||
def isexpr(self) -> bool: ...
|
||||
|
||||
@@ -2,6 +2,7 @@ import sys
|
||||
from _typeshed import FileDescriptorLike, Self
|
||||
from types import TracebackType
|
||||
from typing import Any, Iterable
|
||||
from typing_extensions import final
|
||||
|
||||
if sys.platform != "win32":
|
||||
PIPE_BUF: int
|
||||
@@ -33,6 +34,7 @@ error = OSError
|
||||
|
||||
if sys.platform != "linux" and sys.platform != "win32":
|
||||
# BSD only
|
||||
@final
|
||||
class kevent:
|
||||
data: Any
|
||||
fflags: int
|
||||
@@ -50,6 +52,7 @@ if sys.platform != "linux" and sys.platform != "win32":
|
||||
udata: Any = ...,
|
||||
) -> None: ...
|
||||
# BSD only
|
||||
@final
|
||||
class kqueue:
|
||||
closed: bool
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
@@ -13,6 +13,7 @@ if sys.version_info >= (3, 9):
|
||||
|
||||
Any = object()
|
||||
|
||||
@_final
|
||||
class TypeVar:
|
||||
__name__: str
|
||||
__bound__: Any | None
|
||||
@@ -30,6 +31,7 @@ class TypeVar:
|
||||
_promote = object()
|
||||
|
||||
# N.B. Keep this definition in sync with typing_extensions._SpecialForm
|
||||
@_final
|
||||
class _SpecialForm:
|
||||
def __getitem__(self, typeargs: Any) -> object: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@@ -748,6 +750,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
|
||||
def type_check_only(func_or_cls: _F) -> _F: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@_final
|
||||
class ForwardRef:
|
||||
__forward_arg__: str
|
||||
__forward_code__: CodeType
|
||||
|
||||
@@ -150,6 +150,7 @@ NotRequired: _SpecialForm
|
||||
LiteralString: _SpecialForm
|
||||
Unpack: _SpecialForm
|
||||
|
||||
@final
|
||||
class TypeVarTuple:
|
||||
__name__: str
|
||||
def __init__(self, name: str) -> None: ...
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import sys
|
||||
from typing import Any
|
||||
from typing_extensions import final
|
||||
|
||||
class Str: ...
|
||||
|
||||
@final
|
||||
class Xxo:
|
||||
def demo(self) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user