Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -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: ...