1
+ import builtins
1
2
import sys
2
3
from _typeshed import Unused
3
4
from enum import Enum
4
5
from typing_extensions import TypeAlias
5
6
6
- # Because UUID has properties called int and bytes we need to rename these temporarily.
7
- _Int : TypeAlias = int
8
- _Bytes : TypeAlias = bytes
9
7
_FieldsType : TypeAlias = tuple [int , int , int , int , int , int ]
10
8
11
9
class SafeUUID (Enum ):
@@ -17,49 +15,49 @@ class UUID:
17
15
def __init__ (
18
16
self ,
19
17
hex : str | None = None ,
20
- bytes : _Bytes | None = None ,
21
- bytes_le : _Bytes | None = None ,
18
+ bytes : builtins . bytes | None = None ,
19
+ bytes_le : builtins . bytes | None = None ,
22
20
fields : _FieldsType | None = None ,
23
- int : _Int | None = None ,
24
- version : _Int | None = None ,
21
+ int : builtins . int | None = None ,
22
+ version : builtins . int | None = None ,
25
23
* ,
26
24
is_safe : SafeUUID = ...,
27
25
) -> None : ...
28
26
@property
29
27
def is_safe (self ) -> SafeUUID : ...
30
28
@property
31
- def bytes (self ) -> _Bytes : ...
29
+ def bytes (self ) -> builtins . bytes : ...
32
30
@property
33
- def bytes_le (self ) -> _Bytes : ...
31
+ def bytes_le (self ) -> builtins . bytes : ...
34
32
@property
35
- def clock_seq (self ) -> _Int : ...
33
+ def clock_seq (self ) -> builtins . int : ...
36
34
@property
37
- def clock_seq_hi_variant (self ) -> _Int : ...
35
+ def clock_seq_hi_variant (self ) -> builtins . int : ...
38
36
@property
39
- def clock_seq_low (self ) -> _Int : ...
37
+ def clock_seq_low (self ) -> builtins . int : ...
40
38
@property
41
39
def fields (self ) -> _FieldsType : ...
42
40
@property
43
41
def hex (self ) -> str : ...
44
42
@property
45
- def int (self ) -> _Int : ...
43
+ def int (self ) -> builtins . int : ...
46
44
@property
47
- def node (self ) -> _Int : ...
45
+ def node (self ) -> builtins . int : ...
48
46
@property
49
- def time (self ) -> _Int : ...
47
+ def time (self ) -> builtins . int : ...
50
48
@property
51
- def time_hi_version (self ) -> _Int : ...
49
+ def time_hi_version (self ) -> builtins . int : ...
52
50
@property
53
- def time_low (self ) -> _Int : ...
51
+ def time_low (self ) -> builtins . int : ...
54
52
@property
55
- def time_mid (self ) -> _Int : ...
53
+ def time_mid (self ) -> builtins . int : ...
56
54
@property
57
55
def urn (self ) -> str : ...
58
56
@property
59
57
def variant (self ) -> str : ...
60
58
@property
61
- def version (self ) -> _Int | None : ...
62
- def __int__ (self ) -> _Int : ...
59
+ def version (self ) -> builtins . int | None : ...
60
+ def __int__ (self ) -> builtins . int : ...
63
61
def __eq__ (self , other : object ) -> bool : ...
64
62
def __lt__ (self , other : UUID ) -> bool : ...
65
63
def __le__ (self , other : UUID ) -> bool : ...
@@ -72,7 +70,7 @@ if sys.version_info >= (3, 9):
72
70
else :
73
71
def getnode (* , getters : Unused = None ) -> int : ... # undocumented
74
72
75
- def uuid1 (node : _Int | None = None , clock_seq : _Int | None = None ) -> UUID : ...
73
+ def uuid1 (node : int | None = None , clock_seq : int | None = None ) -> UUID : ...
76
74
77
75
if sys .version_info >= (3 , 12 ):
78
76
def uuid3 (namespace : UUID , name : str | bytes ) -> UUID : ...
0 commit comments