mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-04 00:52:44 +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
7
third_party/2/enum.pyi
vendored
7
third_party/2/enum.pyi
vendored
@@ -1,4 +1,4 @@
|
||||
from typing import List, Any, TypeVar
|
||||
from typing import List, Any, TypeVar, Type
|
||||
|
||||
class Enum:
|
||||
def __new__(cls, value: Any) -> None: ...
|
||||
@@ -12,8 +12,9 @@ class Enum:
|
||||
name = ... # type: str
|
||||
value = ... # type: Any
|
||||
|
||||
class IntEnum(int, Enum): ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class IntEnum(int, Enum): # type: ignore
|
||||
def __new__(cls: Type[_T], value: Any) -> _T: ...
|
||||
|
||||
def unique(enumeration: _T) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user