mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[uuid] Replace properties with Final fields (#14968)
This commit is contained in:
+6
-5
@@ -1,7 +1,8 @@
|
||||
import builtins
|
||||
import sys
|
||||
from _typeshed import Unused
|
||||
from enum import Enum
|
||||
from typing import Final
|
||||
from typing import Final, NoReturn
|
||||
from typing_extensions import LiteralString, TypeAlias
|
||||
|
||||
_FieldsType: TypeAlias = tuple[int, int, int, int, int, int]
|
||||
@@ -13,6 +14,9 @@ class SafeUUID(Enum):
|
||||
|
||||
class UUID:
|
||||
__slots__ = ("int", "is_safe", "__weakref__")
|
||||
is_safe: Final[SafeUUID]
|
||||
int: Final[builtins.int]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hex: str | None = None,
|
||||
@@ -25,8 +29,6 @@ class UUID:
|
||||
is_safe: SafeUUID = SafeUUID.unknown,
|
||||
) -> None: ...
|
||||
@property
|
||||
def is_safe(self) -> SafeUUID: ...
|
||||
@property
|
||||
def bytes(self) -> builtins.bytes: ...
|
||||
@property
|
||||
def bytes_le(self) -> builtins.bytes: ...
|
||||
@@ -41,8 +43,6 @@ class UUID:
|
||||
@property
|
||||
def hex(self) -> str: ...
|
||||
@property
|
||||
def int(self) -> builtins.int: ...
|
||||
@property
|
||||
def node(self) -> builtins.int: ...
|
||||
@property
|
||||
def time(self) -> builtins.int: ...
|
||||
@@ -65,6 +65,7 @@ class UUID:
|
||||
def __gt__(self, other: UUID) -> bool: ...
|
||||
def __ge__(self, other: UUID) -> bool: ...
|
||||
def __hash__(self) -> builtins.int: ...
|
||||
def __setattr__(self, name: Unused, value: Unused) -> NoReturn: ...
|
||||
|
||||
def getnode() -> int: ...
|
||||
def uuid1(node: int | None = None, clock_seq: int | None = None) -> UUID: ...
|
||||
|
||||
Reference in New Issue
Block a user