| 1 | import builtins |
| 2 | import sys |
| 3 | from _typeshed import Unused |
| 4 | from enum import Enum |
| 5 | from typing import Final, NoReturn |
| 6 | from typing_extensions import LiteralString, TypeAlias |
| 7 | |
| 8 | _FieldsType: TypeAlias = tuple[int, int, int, int, int, int] |
| 9 | |
| 10 | class SafeUUID(Enum): |
| 11 | safe = 0 |
| 12 | unsafe = -1 |
| 13 | unknown = None |
| 14 | |
| 15 | class UUID: |
| 16 | __slots__ = ("int", "is_safe", "__weakref__") |
| 17 | is_safe: Final[SafeUUID] |
| 18 | int: Final[builtins.int] |
| 19 | |
| 20 | def __init__( |
| 21 | self, |
| 22 | hex: str | None = None, |
| 23 | bytes: builtins.bytes | None = None, |
| 24 | bytes_le: builtins.bytes | None = None, |
| 25 | fields: _FieldsType | None = None, |
| 26 | int: builtins.int | None = None, |
| 27 | version: builtins.int | None = None, |
| 28 | *, |
| 29 | is_safe: SafeUUID = SafeUUID.unknown, |
| 30 | ) -> None: ... |
| 31 | @property |
| 32 | def bytes(self) -> builtins.bytes: ... |
| 33 | @property |
| 34 | def bytes_le(self) -> builtins.bytes: ... |
| 35 | @property |
| 36 | def clock_seq(self) -> builtins.int: ... |
| 37 | @property |
| 38 | def clock_seq_hi_variant(self) -> builtins.int: ... |
| 39 | @property |
| 40 | def clock_seq_low(self) -> builtins.int: ... |
| 41 | @property |
| 42 | def fields(self) -> _FieldsType: ... |
| 43 | @property |
| 44 | def hex(self) -> str: ... |
| 45 | @property |
| 46 | def node(self) -> builtins.int: ... |
| 47 | @property |
| 48 | def time(self) -> builtins.int: ... |
| 49 | @property |
| 50 | def time_hi_version(self) -> builtins.int: ... |
| 51 | @property |
| 52 | def time_low(self) -> builtins.int: ... |
| 53 | @property |
| 54 | def time_mid(self) -> builtins.int: ... |
| 55 | @property |
| 56 | def urn(self) -> str: ... |
| 57 | @property |
| 58 | def variant(self) -> str: ... |
| 59 | @property |
| 60 | def version(self) -> builtins.int | None: ... |
| 61 | def __int__(self) -> builtins.int: ... |
| 62 | def __eq__(self, other: object) -> bool: ... |
| 63 | def __lt__(self, other: UUID) -> bool: ... |
| 64 | def __le__(self, other: UUID) -> bool: ... |
| 65 | def __gt__(self, other: UUID) -> bool: ... |
| 66 | def __ge__(self, other: UUID) -> bool: ... |
| 67 | def __hash__(self) -> builtins.int: ... |
| 68 | def __setattr__(self, name: Unused, value: Unused) -> NoReturn: ... |
| 69 | |
| 70 | def getnode() -> int: ... |
| 71 | def uuid1(node: int | None = None, clock_seq: int | None = None) -> UUID: ... |
| 72 | |
| 73 | if sys.version_info >= (3, 14): |
| 74 | def uuid6(node: int | None = None, clock_seq: int | None = None) -> UUID: ... |
| 75 | def uuid7() -> UUID: ... |
| 76 | def uuid8(a: int | None = None, b: int | None = None, c: int | None = None) -> UUID: ... |
| 77 | |
| 78 | if sys.version_info >= (3, 12): |
| 79 | def uuid3(namespace: UUID, name: str | bytes) -> UUID: ... |
| 80 | |
| 81 | else: |
| 82 | def uuid3(namespace: UUID, name: str) -> UUID: ... |
| 83 | |
| 84 | def uuid4() -> UUID: ... |
| 85 | |
| 86 | if sys.version_info >= (3, 12): |
| 87 | def uuid5(namespace: UUID, name: str | bytes) -> UUID: ... |
| 88 | |
| 89 | else: |
| 90 | def uuid5(namespace: UUID, name: str) -> UUID: ... |
| 91 | |
| 92 | if sys.version_info >= (3, 14): |
| 93 | NIL: Final[UUID] |
| 94 | MAX: Final[UUID] |
| 95 | |
| 96 | NAMESPACE_DNS: Final[UUID] |
| 97 | NAMESPACE_URL: Final[UUID] |
| 98 | NAMESPACE_OID: Final[UUID] |
| 99 | NAMESPACE_X500: Final[UUID] |
| 100 | RESERVED_NCS: Final[LiteralString] |
| 101 | RFC_4122: Final[LiteralString] |
| 102 | RESERVED_MICROSOFT: Final[LiteralString] |
| 103 | RESERVED_FUTURE: Final[LiteralString] |
| 104 | |
| 105 | if sys.version_info >= (3, 12): |
| 106 | def main() -> None: ... |