Skip to content

Commit b320f2d

Browse files
committed
Apply python/typeshed#14436 to local typeshed
1 parent 1ff9a00 commit b320f2d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mypy/typeshed/stdlib/collections/__init__.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ _VT = TypeVar("_VT")
3232
_KT_co = TypeVar("_KT_co", covariant=True)
3333
_VT_co = TypeVar("_VT_co", covariant=True)
3434

35+
# at runtime this class is implemented in _collections, but it considers itself to live in collections since Python 3.12
36+
@final
37+
class _tuplegetter(Generic[_T]): # undocumented
38+
def __init__(self, index: SupportsIndex, doc: str, /) -> None: ...
39+
def __reduce__(self) -> tuple[type[Self], tuple[int, str]]: ...
40+
if sys.version_info >= (3, 10):
41+
@overload
42+
def __get__(self, instance: None, owner: type[Any] | None = None, /) -> Self: ...
43+
@overload
44+
def __get__(self, instance: object, owner: type[Any] | None = None, /) -> _T: ...
45+
else:
46+
@overload
47+
def __get__(self, instance: None, owner: type[Any] | None, /) -> Self: ...
48+
@overload
49+
def __get__(self, instance: object, owner: type[Any] | None, /) -> _T: ...
50+
3551
# namedtuple is special-cased in the type checker; the initializer is ignored.
3652
def namedtuple(
3753
typename: str,

0 commit comments

Comments
 (0)