mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Update typing_extensions for 4.7.* (#10344)
This commit is contained in:
@@ -21,7 +21,7 @@ stubdefaulter==0.1.0
|
||||
termcolor>=2.3
|
||||
tomli==2.0.1
|
||||
tomlkit==0.11.8
|
||||
typing-extensions==4.6.3
|
||||
typing_extensions
|
||||
|
||||
# Type stubs used to type check our scripts.
|
||||
types-pyyaml>=6.0.12.7
|
||||
|
||||
@@ -956,3 +956,7 @@ if sys.version_info >= (3, 12):
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def is_protocol(__tp: type) -> bool: ...
|
||||
def get_protocol_members(__tp: type) -> frozenset[str]: ...
|
||||
|
||||
@@ -4,26 +4,52 @@ import sys
|
||||
import typing
|
||||
from _collections_abc import dict_items, dict_keys, dict_values
|
||||
from _typeshed import IdentityFunction, Incomplete
|
||||
from collections.abc import Iterable
|
||||
from typing import ( # noqa: Y022,Y039
|
||||
from typing import ( # noqa: Y022,Y037,Y038,Y039
|
||||
IO as IO,
|
||||
TYPE_CHECKING as TYPE_CHECKING,
|
||||
AbstractSet as AbstractSet,
|
||||
Any as Any,
|
||||
AnyStr as AnyStr,
|
||||
AsyncContextManager as AsyncContextManager,
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
Awaitable as Awaitable,
|
||||
Callable,
|
||||
BinaryIO as BinaryIO,
|
||||
Callable as Callable,
|
||||
ChainMap as ChainMap,
|
||||
ClassVar as ClassVar,
|
||||
Collection as Collection,
|
||||
Container as Container,
|
||||
ContextManager as ContextManager,
|
||||
Coroutine as Coroutine,
|
||||
Counter as Counter,
|
||||
DefaultDict as DefaultDict,
|
||||
Deque as Deque,
|
||||
Mapping,
|
||||
Dict as Dict,
|
||||
ForwardRef as ForwardRef,
|
||||
FrozenSet as FrozenSet,
|
||||
Generator as Generator,
|
||||
Generic as Generic,
|
||||
Hashable as Hashable,
|
||||
ItemsView as ItemsView,
|
||||
Iterable as Iterable,
|
||||
Iterator as Iterator,
|
||||
KeysView as KeysView,
|
||||
List as List,
|
||||
Mapping as Mapping,
|
||||
MappingView as MappingView,
|
||||
Match as Match,
|
||||
MutableMapping as MutableMapping,
|
||||
MutableSequence as MutableSequence,
|
||||
MutableSet as MutableSet,
|
||||
NoReturn as NoReturn,
|
||||
Sequence,
|
||||
Optional as Optional,
|
||||
Pattern as Pattern,
|
||||
Reversible as Reversible,
|
||||
Sequence as Sequence,
|
||||
Set as Set,
|
||||
Sized as Sized,
|
||||
SupportsAbs as SupportsAbs,
|
||||
SupportsBytes as SupportsBytes,
|
||||
SupportsComplex as SupportsComplex,
|
||||
@@ -31,8 +57,15 @@ from typing import ( # noqa: Y022,Y039
|
||||
SupportsInt as SupportsInt,
|
||||
SupportsRound as SupportsRound,
|
||||
Text as Text,
|
||||
TextIO as TextIO,
|
||||
Tuple as Tuple,
|
||||
Type as Type,
|
||||
Union as Union,
|
||||
ValuesView as ValuesView,
|
||||
_Alias,
|
||||
cast as cast,
|
||||
no_type_check as no_type_check,
|
||||
no_type_check_decorator as no_type_check_decorator,
|
||||
overload as overload,
|
||||
type_check_only,
|
||||
)
|
||||
@@ -109,6 +142,45 @@ __all__ = [
|
||||
"get_original_bases",
|
||||
"get_overloads",
|
||||
"get_type_hints",
|
||||
"AbstractSet",
|
||||
"AnyStr",
|
||||
"BinaryIO",
|
||||
"Callable",
|
||||
"Collection",
|
||||
"Container",
|
||||
"Dict",
|
||||
"ForwardRef",
|
||||
"FrozenSet",
|
||||
"Generator",
|
||||
"Generic",
|
||||
"Hashable",
|
||||
"IO",
|
||||
"ItemsView",
|
||||
"Iterable",
|
||||
"Iterator",
|
||||
"KeysView",
|
||||
"List",
|
||||
"Mapping",
|
||||
"MappingView",
|
||||
"Match",
|
||||
"MutableMapping",
|
||||
"MutableSequence",
|
||||
"MutableSet",
|
||||
"Optional",
|
||||
"Pattern",
|
||||
"Reversible",
|
||||
"Sequence",
|
||||
"Set",
|
||||
"Sized",
|
||||
"TextIO",
|
||||
"Tuple",
|
||||
"Union",
|
||||
"ValuesView",
|
||||
"cast",
|
||||
"get_protocol_members",
|
||||
"is_protocol",
|
||||
"no_type_check",
|
||||
"no_type_check_decorator",
|
||||
]
|
||||
|
||||
_T = typing.TypeVar("_T")
|
||||
@@ -403,3 +475,9 @@ else:
|
||||
# Not actually a Protocol at runtime; see
|
||||
# https://github.com/python/typeshed/issues/10224 for why we're defining it this way
|
||||
def __buffer__(self, __flags: int) -> memoryview: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
from typing import get_protocol_members as get_protocol_members, is_protocol as is_protocol
|
||||
else:
|
||||
def is_protocol(__tp: type) -> bool: ...
|
||||
def get_protocol_members(__tp: type) -> frozenset[str]: ...
|
||||
|
||||
@@ -118,14 +118,14 @@ _collections_abc.MutableMapping.setdefault
|
||||
|
||||
# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
|
||||
# to mark these as positional-only for compatibility with existing sub-classes.
|
||||
typing.BinaryIO.write
|
||||
typing.IO.read
|
||||
typing.IO.readline
|
||||
typing.IO.readlines
|
||||
typing.IO.seek
|
||||
typing.IO.truncate
|
||||
typing.IO.write
|
||||
typing.IO.writelines
|
||||
typing(_extensions)?\.BinaryIO\.write
|
||||
typing(_extensions)?\.IO\.read
|
||||
typing(_extensions)?\.IO\.readline
|
||||
typing(_extensions)?\.IO\.readlines
|
||||
typing(_extensions)?\.IO\.seek
|
||||
typing(_extensions)?\.IO\.truncate
|
||||
typing(_extensions)?\.IO\.write
|
||||
typing(_extensions)?\.IO\.writelines
|
||||
|
||||
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
|
||||
_collections_abc.Coroutine.send
|
||||
|
||||
@@ -50,14 +50,14 @@ _collections_abc.MutableMapping.setdefault
|
||||
|
||||
# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
|
||||
# to mark these as positional-only for compatibility with existing sub-classes.
|
||||
typing.BinaryIO.write
|
||||
typing.IO.read
|
||||
typing.IO.readline
|
||||
typing.IO.readlines
|
||||
typing.IO.seek
|
||||
typing.IO.truncate
|
||||
typing.IO.write
|
||||
typing.IO.writelines
|
||||
typing(_extensions)?\.BinaryIO\.write
|
||||
typing(_extensions)?\.IO\.read
|
||||
typing(_extensions)?\.IO\.readline
|
||||
typing(_extensions)?\.IO\.readlines
|
||||
typing(_extensions)?\.IO\.seek
|
||||
typing(_extensions)?\.IO\.truncate
|
||||
typing(_extensions)?\.IO\.write
|
||||
typing(_extensions)?\.IO\.writelines
|
||||
|
||||
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
|
||||
_collections_abc.Coroutine.send
|
||||
|
||||
@@ -163,14 +163,14 @@ _collections_abc.MutableMapping.setdefault
|
||||
|
||||
# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
|
||||
# to mark these as positional-only for compatibility with existing sub-classes.
|
||||
typing.BinaryIO.write
|
||||
typing.IO.read
|
||||
typing.IO.readline
|
||||
typing.IO.readlines
|
||||
typing.IO.seek
|
||||
typing.IO.truncate
|
||||
typing.IO.write
|
||||
typing.IO.writelines
|
||||
typing(_extensions)?\.BinaryIO\.write
|
||||
typing(_extensions)?\.IO\.read
|
||||
typing(_extensions)?\.IO\.readline
|
||||
typing(_extensions)?\.IO\.readlines
|
||||
typing(_extensions)?\.IO\.seek
|
||||
typing(_extensions)?\.IO\.truncate
|
||||
typing(_extensions)?\.IO\.write
|
||||
typing(_extensions)?\.IO\.writelines
|
||||
|
||||
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
|
||||
_collections_abc.Coroutine.send
|
||||
|
||||
@@ -99,7 +99,7 @@ tkinter.tix.[A-Z_]+
|
||||
tkinter.tix.TclVersion
|
||||
tkinter.tix.TkVersion
|
||||
traceback.TracebackException.from_exception # explicitly expanding arguments going into TracebackException __init__
|
||||
typing.IO.__next__ # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
|
||||
typing(_extensions)?\.IO\.__next__ # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
|
||||
typing.type_check_only # typing decorator that is not available at runtime
|
||||
unittest.mock.patch # It's a complicated overload and I haven't been able to figure out why stubtest doesn't like it
|
||||
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
|
||||
@@ -383,8 +383,9 @@ tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, a
|
||||
typing_extensions\._SpecialForm.*
|
||||
typing_extensions\.TypeVar.*
|
||||
typing_extensions\.ParamSpec.*
|
||||
typing\.Generic
|
||||
typing(_extensions)?\.Generic
|
||||
typing\.Protocol
|
||||
typing_extensions\._TypedDict\..*
|
||||
|
||||
# Special primitives
|
||||
typing_extensions\.Annotated
|
||||
@@ -392,36 +393,33 @@ typing_extensions\.NamedTuple
|
||||
typing_extensions\.LiteralString
|
||||
typing_extensions\.Coroutine
|
||||
typing_extensions\.Awaitable
|
||||
typing_extensions\.AsyncIterator
|
||||
typing_extensions\.AsyncIterable
|
||||
typing_extensions\.AsyncGenerator
|
||||
typing\.ValuesView
|
||||
typing\.Sized
|
||||
typing\.Sequence
|
||||
typing\.Reversible
|
||||
typing\.Pattern
|
||||
typing\.MutableSet
|
||||
typing\.MutableSequence
|
||||
typing\.MutableMapping
|
||||
typing\.Match
|
||||
typing\.MappingView
|
||||
typing\.Mapping
|
||||
typing\.KeysView
|
||||
typing\.Iterator
|
||||
typing\.Iterable
|
||||
typing\.ItemsView
|
||||
typing\.Hashable
|
||||
typing\.Generator
|
||||
typing\.Coroutine
|
||||
typing\.Collection
|
||||
typing\.Container
|
||||
typing(_extensions)?\.AsyncIterator
|
||||
typing(_extensions)?\.AsyncIterable
|
||||
typing(_extensions)?\.AsyncGenerator
|
||||
typing(_extensions)?\.ValuesView
|
||||
typing(_extensions)?\.Sized
|
||||
typing(_extensions)?\.Sequence
|
||||
typing(_extensions)?\.Reversible
|
||||
typing(_extensions)?\.Pattern
|
||||
typing(_extensions)?\.MutableSet
|
||||
typing(_extensions)?\.MutableSequence
|
||||
typing(_extensions)?\.MutableMapping
|
||||
typing(_extensions)?\.Match
|
||||
typing(_extensions)?\.MappingView
|
||||
typing(_extensions)?\.Mapping
|
||||
typing(_extensions)?\.KeysView
|
||||
typing(_extensions)?\.Iterator
|
||||
typing(_extensions)?\.Iterable
|
||||
typing(_extensions)?\.ItemsView
|
||||
typing(_extensions)?\.Hashable
|
||||
typing(_extensions)?\.Generator
|
||||
typing(_extensions)?\.Coroutine
|
||||
typing(_extensions)?\.Collection
|
||||
typing(_extensions)?\.Container
|
||||
typing\.ByteString
|
||||
typing\.AwaitableGenerator
|
||||
typing\.Awaitable
|
||||
typing\.AsyncIterator
|
||||
typing\.AsyncIterable
|
||||
typing\.AsyncGenerator
|
||||
typing\.AbstractSet
|
||||
typing(_extensions)?\.AwaitableGenerator
|
||||
typing(_extensions)?\.Awaitable
|
||||
typing(_extensions)?\.AbstractSet
|
||||
|
||||
typing_extensions.NewType.__mro_entries__ # just exists for an error message
|
||||
|
||||
@@ -429,6 +427,8 @@ typing_extensions.NewType.__mro_entries__ # just exists for an error message
|
||||
typing_extensions.NewType.__call__
|
||||
typing_extensions\.deprecated
|
||||
typing_extensions\.override
|
||||
typing_extensions\.get_protocol_members
|
||||
typing_extensions\.is_protocol
|
||||
|
||||
# Typing-related weirdness
|
||||
_collections_abc.Callable
|
||||
@@ -443,14 +443,14 @@ _collections_abc.ByteString
|
||||
|
||||
# These are abstract properties at runtime,
|
||||
# but marking them as such in the stub breaks half the the typed-Python ecosystem (see #8726)
|
||||
typing.IO.closed
|
||||
typing.IO.mode
|
||||
typing.IO.name
|
||||
typing.TextIO.buffer
|
||||
typing.TextIO.encoding
|
||||
typing.TextIO.errors
|
||||
typing.TextIO.line_buffering
|
||||
typing.TextIO.newlines
|
||||
typing(_extensions)?\.IO\.closed
|
||||
typing(_extensions)?\.IO\.mode
|
||||
typing(_extensions)?\.IO\.name
|
||||
typing(_extensions)?\.TextIO\.buffer
|
||||
typing(_extensions)?\.TextIO\.encoding
|
||||
typing(_extensions)?\.TextIO\.errors
|
||||
typing(_extensions)?\.TextIO\.line_buffering
|
||||
typing(_extensions)?\.TextIO\.newlines
|
||||
|
||||
types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
|
||||
types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist.
|
||||
@@ -599,7 +599,7 @@ mmap.mmap.__iter__
|
||||
mmap.mmap.__contains__
|
||||
xml.etree.ElementTree.Element.__iter__
|
||||
xml.etree.cElementTree.Element.__iter__
|
||||
typing.IO.__iter__ # See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
|
||||
typing(_extensions)?\.IO\.__iter__ # See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
|
||||
|
||||
# LC_MESSAGES is sometimes present in __all__, sometimes not,
|
||||
# so stubtest will sometimes complain about exported names being different at runtime to the exported names in the stub
|
||||
|
||||
Reference in New Issue
Block a user