mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Any, Tuple
|
||||
|
||||
# Because UUID has properties called int and bytes we need to rename these temporarily.
|
||||
_Int = int
|
||||
@@ -17,12 +17,12 @@ class UUID:
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
hex: Optional[str] = ...,
|
||||
bytes: Optional[_Bytes] = ...,
|
||||
bytes_le: Optional[_Bytes] = ...,
|
||||
fields: Optional[_FieldsType] = ...,
|
||||
int: Optional[_Int] = ...,
|
||||
version: Optional[_Int] = ...,
|
||||
hex: str | None = ...,
|
||||
bytes: _Bytes | None = ...,
|
||||
bytes_le: _Bytes | None = ...,
|
||||
fields: _FieldsType | None = ...,
|
||||
int: _Int | None = ...,
|
||||
version: _Int | None = ...,
|
||||
*,
|
||||
is_safe: SafeUUID = ...,
|
||||
) -> None: ...
|
||||
@@ -31,12 +31,12 @@ class UUID:
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
hex: Optional[str] = ...,
|
||||
bytes: Optional[_Bytes] = ...,
|
||||
bytes_le: Optional[_Bytes] = ...,
|
||||
fields: Optional[_FieldsType] = ...,
|
||||
int: Optional[_Int] = ...,
|
||||
version: Optional[_Int] = ...,
|
||||
hex: str | None = ...,
|
||||
bytes: _Bytes | None = ...,
|
||||
bytes_le: _Bytes | None = ...,
|
||||
fields: _FieldsType | None = ...,
|
||||
int: _Int | None = ...,
|
||||
version: _Int | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def bytes(self) -> _Bytes: ...
|
||||
@@ -69,7 +69,7 @@ class UUID:
|
||||
@property
|
||||
def variant(self) -> str: ...
|
||||
@property
|
||||
def version(self) -> Optional[_Int]: ...
|
||||
def version(self) -> _Int | None: ...
|
||||
def __int__(self) -> _Int: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __lt__(self, other: Any) -> bool: ...
|
||||
@@ -78,7 +78,7 @@ class UUID:
|
||||
def __ge__(self, other: Any) -> bool: ...
|
||||
|
||||
def getnode() -> int: ...
|
||||
def uuid1(node: Optional[_Int] = ..., clock_seq: Optional[_Int] = ...) -> UUID: ...
|
||||
def uuid1(node: _Int | None = ..., clock_seq: _Int | None = ...) -> UUID: ...
|
||||
def uuid3(namespace: UUID, name: str) -> UUID: ...
|
||||
def uuid4() -> UUID: ...
|
||||
def uuid5(namespace: UUID, name: str) -> UUID: ...
|
||||
|
||||
Reference in New Issue
Block a user