mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
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:
committed by
Jelle Zijlstra
parent
ed6dc176da
commit
fed4e03e53
@@ -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: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user