Files
typeshed/stdlib/3/abc.pyi
Dominik Miedziński 4f51a4f2fc Improve ABCMeta.register signature (#962)
* Improve ABCMeta.register signature

* Fix ABCMeta.register return type for Python 3.3+
2017-03-07 16:42:06 -08:00

19 lines
493 B
Python

from typing import Any, Type, TypeVar
import sys
# Stubs for abc.
_T = TypeVar('_T')
# Thesee definitions have special processing in type checker.
class ABCMeta(type):
if sys.version_info >= (3, 3):
def register(cls: "ABCMeta", subclass: Type[_T]) -> Type[_T]: ...
else:
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
abstractmethod = object()
abstractproperty = object()
if sys.version_info >= (3, 4):
class ABC(metaclass=ABCMeta):
pass