make __class__ refer to the current object's class (#1549)

Fixes python/mypy#3061
This commit is contained in:
Jelle Zijlstra
2017-09-27 21:11:59 -04:00
committed by Matthias Kramm
parent d389ef3d85
commit 1a164b630c
4 changed files with 9 additions and 5 deletions

View File

@@ -29,13 +29,16 @@ _TT = TypeVar('_TT', bound='type')
class object:
__doc__ = ... # type: Optional[str]
__class__ = ... # type: type
__dict__ = ... # type: Dict[str, Any]
__slots__ = ... # type: Optional[Union[str, Iterable[str]]]
__module__ = ... # type: str
if sys.version_info >= (3, 6):
__annotations__ = ... # type: Dict[str, Any]
@property
def __class__(self: _T) -> Type[_T]: ...
@__class__.setter
def __class__(self, __type: Type[object]) -> None: ...
def __init__(self) -> None: ...
def __new__(cls) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...