1
1
# FIXME: Stub incomplete, ommissions include:
2
2
# * the metaclass
3
- # * _sunder_ methods with their transformations
4
3
5
4
import sys
6
5
from typing import List , Any , TypeVar , Union
7
6
7
+ _T = TypeVar ('_T' )
8
+
8
9
class Enum :
9
10
def __new__ (cls , value : Any ) -> None : ...
10
11
def __repr__ (self ) -> str : ...
@@ -14,14 +15,21 @@ class Enum:
14
15
def __hash__ (self ) -> Any : ...
15
16
def __reduce_ex__ (self , proto : Any ) -> Any : ...
16
17
18
+ if sys .version_info >= (3 , 6 ):
19
+ # mypy complains here that the type of the first argument is not 'self', but that is correct
20
+ # because this is an implicit staticmethod. Making it an explicit staticmethod silences
21
+ # mypy, but does not actually work at runtime.
22
+ def _generate_next_value_ (name : str , start : int , count : int , last_values : List [Any ]) -> Any : ... # type: ignore
23
+ @classmethod
24
+ def _missing_ (self , value : Any ) -> Any : ...
25
+ _order_ = ... # type: Union[str, List[str]]
26
+
17
27
name = ... # type: str
18
28
value = ... # type: Any
19
29
20
30
class IntEnum (int , Enum ):
21
31
value = ... # type: int
22
32
23
- _T = TypeVar ('_T' )
24
-
25
33
def unique (enumeration : _T ) -> _T : ...
26
34
27
35
if sys .version_info >= (3 , 6 ):
0 commit comments