1
- from typing import List , Any , TypeVar
1
+ # FIXME: Stub incomplete, ommissions include:
2
+ # * the metaclass
3
+ # * _sunder_ methods with their transformations
4
+
5
+ import sys
6
+ from typing import List , Any , TypeVar , Union
2
7
3
8
class Enum :
4
9
def __new__ (cls , value : Any ) -> None : ...
@@ -18,3 +23,28 @@ class IntEnum(int, Enum):
18
23
_T = TypeVar ('_T' )
19
24
20
25
def unique (enumeration : _T ) -> _T : ...
26
+
27
+ if sys .version_info >= (3 , 6 ):
28
+ _auto_null = ... # type: Any
29
+
30
+ class auto :
31
+ value = ... # type: Any
32
+
33
+ class Flag (Enum ):
34
+ def __contains__ (self : _T , other : _T ) -> bool : ...
35
+ def __repr__ (self ) -> str : ...
36
+ def __str__ (self ) -> str : ...
37
+ def __bool__ (self ) -> bool : ...
38
+ def __or__ (self : _T , other : _T ) -> _T : ...
39
+ def __and__ (self : _T , other : _T ) -> _T : ...
40
+ def __xor__ (self : _T , other : _T ) -> _T : ...
41
+ def __invert__ (self : _T ) -> _T : ...
42
+
43
+ # All `type: ignore` comments below due to IntFlag making the function signatures more permissive.
44
+ class IntFlag (int , Flag ): # type: ignore
45
+ def __or__ (self : _T , other : Union [int , _T ]) -> _T : ... # type: ignore
46
+ def __and__ (self : _T , other : Union [int , _T ]) -> _T : ... # type: ignore
47
+ def __xor__ (self : _T , other : Union [int , _T ]) -> _T : ... # type: ignore
48
+ __ror__ = __or__
49
+ __rand__ = __and__
50
+ __rxor__ = __xor__
0 commit comments