Make property a type (#199)

This commit is contained in:
beckjake
2016-05-16 14:24:55 -06:00
committed by Guido van Rossum
parent 3e37029bfe
commit 70389d14ee
2 changed files with 22 additions and 2 deletions

View File

@@ -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

View File

@@ -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: ...