Change get_cache_token to return a NewType in _py_abc (#6872)

This commit is contained in:
Nikita Sobolev
2022-01-09 20:33:45 +03:00
committed by GitHub
parent da3292d271
commit 34426dbc20

View File

@@ -1,9 +1,10 @@
from typing import Any, TypeVar
from typing import Any, NewType, TypeVar
_T = TypeVar("_T")
# TODO: Change the return into a NewType bound to int after pytype/#597
def get_cache_token() -> object: ...
_CacheToken = NewType("_CacheToken", int)
def get_cache_token() -> _CacheToken: ...
class ABCMeta(type):
def __new__(__mcls, __name: str, __bases: tuple[type[Any], ...], __namespace: dict[str, Any]) -> ABCMeta: ...