Add __new__ to str and int stubs in both Pythons. (#1352)

* Update default values to `...` in `__init__` and `__new__` in `int` and `str`.
* Add `__new__` to `enum.IntEnum` to override inherited `__new__`.
* Add `type: ignore` comment to `IntEnum`
This commit is contained in:
Semyon Proshev
2017-06-13 06:53:32 +03:00
committed by Jelle Zijlstra
parent ed6dc176da
commit fed4e03e53
4 changed files with 34 additions and 12 deletions

View File

@@ -24,8 +24,11 @@ class Enum(metaclass=EnumMeta):
name = ... # type: str
value = ... # type: Any
class IntEnum(int, Enum):
_T1 = TypeVar('_T1')
class IntEnum(int, Enum): # type: ignore
value = ... # type: int
def __new__(cls: Type[_T1], value: Any) -> _T1: ...
def unique(enumeration: _S) -> _S: ...