PY2: UUID accepts both unicode and str (#2478)

This commit is contained in:
Michael R. Crusoe
2018-09-26 14:31:04 +03:00
committed by Sebastian Rittau
parent 6968ff6cb0
commit 3af4ff9f94

View File

@@ -1,7 +1,7 @@
# Stubs for uuid
import sys
from typing import Tuple, Optional, Any
from typing import Tuple, Optional, Any, Text
# Because UUID has properties called int and bytes we need to rename these temporarily.
_Int = int
@@ -9,7 +9,8 @@ _Bytes = bytes
_FieldsType = Tuple[int, int, int, int, int, int]
class UUID:
def __init__(self, hex: Optional[str] = ..., bytes: Optional[_Bytes] = ...,
def __init__(self, hex: Optional[Text] = ...,
bytes: Optional[_Bytes] = ...,
bytes_le: Optional[_Bytes] = ...,
fields: Optional[_FieldsType] = ...,
int: Optional[_Int] = ...,