Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Optional, Text, Tuple
from typing import Any, Text, Tuple
# Because UUID has properties called int and bytes we need to rename these temporarily.
_Int = int
@@ -8,12 +8,12 @@ _FieldsType = Tuple[int, int, int, int, int, int]
class UUID:
def __init__(
self,
hex: Optional[Text] = ...,
bytes: Optional[_Bytes] = ...,
bytes_le: Optional[_Bytes] = ...,
fields: Optional[_FieldsType] = ...,
int: Optional[_Int] = ...,
version: Optional[_Int] = ...,
hex: Text | None = ...,
bytes: _Bytes | None = ...,
bytes_le: _Bytes | None = ...,
fields: _FieldsType | None = ...,
int: _Int | None = ...,
version: _Int | None = ...,
) -> None: ...
@property
def bytes(self) -> _Bytes: ...
@@ -46,7 +46,7 @@ class UUID:
@property
def variant(self) -> str: ...
@property
def version(self) -> Optional[_Int]: ...
def version(self) -> _Int | None: ...
def __int__(self) -> _Int: ...
def get_bytes(self) -> _Bytes: ...
def get_bytes_le(self) -> _Bytes: ...
@@ -62,11 +62,11 @@ class UUID:
def get_time_mid(self) -> _Int: ...
def get_urn(self) -> str: ...
def get_variant(self) -> str: ...
def get_version(self) -> Optional[_Int]: ...
def get_version(self) -> _Int | None: ...
def __cmp__(self, other: Any) -> _Int: ...
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: ...