mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Improve ABCMeta.register signature (#962)
* Improve ABCMeta.register signature * Fix ABCMeta.register return type for Python 3.3+
This commit is contained in:
committed by
Matthias Kramm
parent
8e59579953
commit
4f51a4f2fc
@@ -1,10 +1,15 @@
|
||||
from typing import Any
|
||||
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):
|
||||
def register(cls: "ABCMeta", subclass: Any) -> None: ...
|
||||
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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user