mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Make property a type (#199)
This commit is contained in:
committed by
Guido van Rossum
parent
3e37029bfe
commit
70389d14ee
@@ -24,7 +24,6 @@ _T4 = TypeVar('_T4')
|
||||
|
||||
staticmethod = object() # Special, only valid as a decorator.
|
||||
classmethod = object() # Special, only valid as a decorator.
|
||||
property = object()
|
||||
|
||||
class object:
|
||||
__doc__ = ... # type: str
|
||||
@@ -647,6 +646,17 @@ class module:
|
||||
__file__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[unicode, Any]
|
||||
|
||||
class property:
|
||||
def __init__(self, fget: Callable[[Any], Any] = None,
|
||||
fset: Callable[[Any, Any], None] = None,
|
||||
fdel: Callable[[Any], None] = None, doc: str = None) -> None: ...
|
||||
def getter(self, fget: Callable[[Any], Any]) -> property: ...
|
||||
def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
|
||||
def deleter(self, fdel: Callable[[Any], None]) -> property: ...
|
||||
def __get__(self, obj: Any, type: type=None) -> Any: ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
def __del__(self, obj: Any) -> None: ...
|
||||
|
||||
long = int
|
||||
bytes = str
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ _T4 = TypeVar('_T4')
|
||||
|
||||
staticmethod = object() # Only valid as a decorator.
|
||||
classmethod = object() # Only valid as a decorator.
|
||||
property = object()
|
||||
|
||||
class object:
|
||||
__doc__ = ... # type: str
|
||||
@@ -622,6 +621,17 @@ class module:
|
||||
__file__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[str, Any]
|
||||
|
||||
class property:
|
||||
def __init__(self, fget: Callable[[Any], Any] = None,
|
||||
fset: Callable[[Any, Any], None] = None,
|
||||
fdel: Callable[[Any], None] = None, doc: str = None) -> None: ...
|
||||
def getter(self, fget: Callable[[Any], Any]) -> property: ...
|
||||
def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
|
||||
def deleter(self, fdel: Callable[[Any], None]) -> property: ...
|
||||
def __get__(self, obj: Any, type: type=None) -> Any: ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
def __del__(self, obj: Any) -> None: ...
|
||||
|
||||
NotImplemented = ... # type: Any
|
||||
|
||||
def abs(n: SupportsAbs[_T]) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user