mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Use _typeshed.Self in Python 2, too (#6932)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import abc
|
||||
import sys
|
||||
from _typeshed import Self as TypeshedSelf # see #6932 for why the alias cannot have a leading underscore
|
||||
from typing import (
|
||||
TYPE_CHECKING as TYPE_CHECKING,
|
||||
Any,
|
||||
@@ -62,7 +63,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
|
||||
__required_keys__: frozenset[str]
|
||||
__optional_keys__: frozenset[str]
|
||||
__total__: bool
|
||||
def copy(self: _T) -> _T: ...
|
||||
def copy(self: TypeshedSelf) -> TypeshedSelf: ...
|
||||
# Using NoReturn so that only calls using mypy plugin hook that specialize the signature
|
||||
# can go through.
|
||||
def setdefault(self, k: NoReturn, default: object) -> object: ...
|
||||
|
||||
Reference in New Issue
Block a user