Format: application/octet-stream
1 import sys
2 from typing import Any, Optional, Text, Tuple
3
4 # Because UUID has properties called int and bytes we need to rename these temporarily.
5 _Int = int
6 _Bytes = bytes
7 _FieldsType = Tuple[int, int, int, int, int, int]
8
9 if sys.version_info >= (3, 7):
10 from enum import Enum
11 class SafeUUID(Enum):
12 safe: int
13 unsafe: int
14 unknown: None
15
16 class UUID:
17 if sys.version_info >= (3, 7):
18 def __init__(
19 self,
20 hex: Optional[Text] = ...,
21 bytes: Optional[_Bytes] = ...,
22 bytes_le: Optional[_Bytes] = ...,
23 fields: Optional[_FieldsType] = ...,
24 int: Optional[_Int] = ...,
25 version: Optional[_Int] = ...,
26 *,
27 is_safe: SafeUUID = ...,
28 ) -> None: ...
29 @property
30 def is_safe(self) -> SafeUUID: ...
31 else:
32 def __init__(
33 self,
34 hex: Optional[Text] = ...,
35 bytes: Optional[_Bytes] = ...,
36 bytes_le: Optional[_Bytes] = ...,
37 fields: Optional[_FieldsType] = ...,
38 int: Optional[_Int] = ...,
39 version: Optional[_Int] = ...,
40 ) -> None: ...
41 @property
42 def bytes(self) -> _Bytes: ...
43 @property
44 def bytes_le(self) -> _Bytes: ...
45 @property
46 def clock_seq(self) -> _Int: ...
47 @property
48 def clock_seq_hi_variant(self) -> _Int: ...
49 @property
50 def clock_seq_low(self) -> _Int: ...
51 @property
52 def fields(self) -> _FieldsType: ...
53 @property
54 def hex(self) -> str: ...
55 @property
56 def int(self) -> _Int: ...
57 @property
58 def node(self) -> _Int: ...
59 @property
60 def time(self) -> _Int: ...
61 @property
62 def time_hi_version(self) -> _Int: ...
63 @property
64 def time_low(self) -> _Int: ...
65 @property
66 def time_mid(self) -> _Int: ...
67 @property
68 def urn(self) -> str: ...
69 @property
70 def variant(self) -> str: ...
71 @property
72 def version(self) -> Optional[_Int]: ...
73 def __int__(self) -> _Int: ...
74 if sys.version_info >= (3,):
75 def __eq__(self, other: Any) -> bool: ...
76 def __lt__(self, other: Any) -> bool: ...
77 def __le__(self, other: Any) -> bool: ...
78 def __gt__(self, other: Any) -> bool: ...
79 def __ge__(self, other: Any) -> bool: ...
80 else:
81 def get_bytes(self) -> _Bytes: ...
82 def get_bytes_le(self) -> _Bytes: ...
83 def get_clock_seq(self) -> _Int: ...
84 def get_clock_seq_hi_variant(self) -> _Int: ...
85 def get_clock_seq_low(self) -> _Int: ...
86 def get_fields(self) -> _FieldsType: ...
87 def get_hex(self) -> str: ...
88 def get_node(self) -> _Int: ...
89 def get_time(self) -> _Int: ...
90 def get_time_hi_version(self) -> _Int: ...
91 def get_time_low(self) -> _Int: ...
92 def get_time_mid(self) -> _Int: ...
93 def get_urn(self) -> str: ...
94 def get_variant(self) -> str: ...
95 def get_version(self) -> Optional[_Int]: ...
96 def __cmp__(self, other: Any) -> _Int: ...
97
98 def getnode() -> int: ...
99 def uuid1(node: Optional[_Int] = ..., clock_seq: Optional[_Int] = ...) -> UUID: ...
100 def uuid3(namespace: UUID, name: str) -> UUID: ...
101 def uuid4() -> UUID: ...
102 def uuid5(namespace: UUID, name: str) -> UUID: ...
103
104 NAMESPACE_DNS: UUID
105 NAMESPACE_URL: UUID
106 NAMESPACE_OID: UUID
107 NAMESPACE_X500: UUID
108 RESERVED_NCS: str
109 RFC_4122: str
110 RESERVED_MICROSOFT: str
111 RESERVED_FUTURE: str
112