diff --git a/stdlib/2/uuid.pyi b/stdlib/2/uuid.pyi deleted file mode 100644 index 8091cda70..000000000 --- a/stdlib/2/uuid.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from typing import Any, Tuple, Optional - -_int = int - -class UUID: - def __init__(self, hex: Optional[str] = ..., bytes: Optional[str] = ..., - bytes_le: Optional[str] = ..., - fields: Optional[Tuple[int, int, int, int, int, int]] = ..., - int: Optional[int] = ..., - version: Optional[int] = ...) -> None: ... - int = ... # type: _int - def get_bytes(self) -> _int: ... - bytes = ... # type: str - def get_bytes_le(self) -> str: ... - bytes_le = ... # type: str - def get_fields(self) -> Tuple[_int, _int, _int, _int, _int, _int]: ... - fields = ... # type: Tuple[_int, _int, _int, _int, _int, _int] - def get_time_low(self) -> _int: ... - time_low = ... # type: _int - def get_time_mid(self) -> _int: ... - time_mid = ... # type: _int - def get_time_hi_version(self) -> _int: ... - time_hi_version = ... # type: _int - def get_clock_seq_hi_variant(self) -> _int: ... - clock_seq_hi_variant = ... # type: _int - def get_clock_seq_low(self) -> _int: ... - clock_seq_low = ... # type: _int - def get_time(self) -> _int: ... - time = ... # type: _int - def get_clock_seq(self) -> _int: ... - clock_seq = ... # type: _int - def get_node(self) -> _int: ... - node = ... # type: _int - def get_hex(self) -> str: ... - hex = ... # type: str - def get_urn(self) -> str: ... - urn = ... # type: str - def get_variant(self) -> _int: ... - variant = ... # type: _int - def get_version(self) -> _int: ... - version = ... # type: _int - -RESERVED_NCS = ... # type: int -RFC_4122 = ... # type: int -RESERVED_MICROSOFT = ... # type: int -RESERVED_FUTURE = ... # type: int - -def getnode() -> int: ... -def uuid1(node: int = ..., clock_seq: int = ...) -> UUID: ... -def uuid3(namespace: UUID, name: str) -> UUID: ... -def uuid4() -> UUID: ... -def uuid5(namespace: UUID, name: str) -> UUID: ... - -NAMESPACE_DNS = ... # type: UUID -NAMESPACE_URL = ... # type: UUID -NAMESPACE_OID = ... # type: UUID -NAMESPACE_X500 = ... # type: UUID diff --git a/stdlib/2and3/uuid.pyi b/stdlib/2and3/uuid.pyi new file mode 100644 index 000000000..dea8f3ee7 --- /dev/null +++ b/stdlib/2and3/uuid.pyi @@ -0,0 +1,87 @@ +# Stubs for uuid + +import sys +from typing import Tuple, Optional, Any + +# Because UUID has properties called int and bytes we need to rename these temporarily. +_Int = int +_Bytes = bytes +_FieldsType = Tuple[int, int, int, int, int, int] + +class UUID: + def __init__(self, hex: Optional[str] = ..., bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ...) -> None: ... + @property + def bytes(self) -> _Bytes: ... + @property + def bytes_le(self) -> _Bytes: ... + @property + def clock_seq(self) -> _Int: ... + @property + def clock_seq_hi_variant(self) -> _Int: ... + @property + def clock_seq_low(self) -> _Int: ... + @property + def fields(self) -> _FieldsType: ... + @property + def hex(self) -> str: ... + @property + def int(self) -> _Int: ... + @property + def node(self) -> _Int: ... + @property + def time(self) -> _Int: ... + @property + def time_hi_version(self) -> _Int: ... + @property + def time_low(self) -> _Int: ... + @property + def time_mid(self) -> _Int: ... + @property + def urn(self) -> str: ... + @property + def variant(self) -> str: ... + @property + def version(self) -> Optional[_Int]: ... + + if sys.version_info >= (3,): + def __eq__(self, other: Any) -> bool: ... + def __lt__(self, other: Any) -> bool: ... + def __le__(self, other: Any) -> bool: ... + def __gt__(self, other: Any) -> bool: ... + def __ge__(self, other: Any) -> bool: ... + else: + def get_bytes(self) -> _Bytes: ... + def get_bytes_le(self) -> _Bytes: ... + def get_clock_seq(self) -> _Int: ... + def get_clock_seq_hi_variant(self) -> _Int: ... + def get_clock_seq_low(self) -> _Int: ... + def get_fields(self) -> _FieldsType: ... + def get_hex(self) -> str: ... + def get_node(self) -> _Int: ... + def get_time(self) -> _Int: ... + def get_time_hi_version(self) -> _Int: ... + def get_time_low(self) -> _Int: ... + def get_time_mid(self) -> _Int: ... + def get_urn(self) -> str: ... + def get_variant(self) -> str: ... + def get_version(self) -> Optional[_Int]: ... + def __cmp__(self, other: Any) -> int: ... + +def getnode() -> int: ... +def uuid1(node: Optional[int] = ..., clock_seq: Optional[int] = ...) -> UUID: ... +def uuid3(namespace: UUID, name: str) -> UUID: ... +def uuid4() -> UUID: ... +def uuid5(namespace: UUID, name: str) -> UUID: ... + +NAMESPACE_DNS = ... # type: UUID +NAMESPACE_URL = ... # type: UUID +NAMESPACE_OID = ... # type: UUID +NAMESPACE_X500 = ... # type: UUID +RESERVED_NCS = ... # type: str +RFC_4122 = ... # type: str +RESERVED_MICROSOFT = ... # type: str +RESERVED_FUTURE = ... # type: str diff --git a/stdlib/3/uuid.pyi b/stdlib/3/uuid.pyi deleted file mode 100644 index efd48e5ed..000000000 --- a/stdlib/3/uuid.pyi +++ /dev/null @@ -1,73 +0,0 @@ -# Stubs for uuid - -from typing import Tuple - -Int = __builtins__.int -Bytes = __builtins__.bytes -FieldsType = Tuple[Int, Int, Int, Int, Int, Int] - -class UUID: - def __init__(self, hex: str=..., bytes: Bytes=..., bytes_le: Bytes=..., fields: FieldsType=..., int: Int=..., version: Int=...) -> None: ... - - @property - def bytes(self) -> Bytes: ... - - @property - def bytes_le(self) -> Bytes: ... - - @property - def clock_seq(self) -> Int: ... - - @property - def clock_seq_hi_variant(self) -> Int: ... - - @property - def clock_seq_low(self) -> Int: ... - - @property - def fields(self) -> FieldsType: ... - - @property - def hex(self) -> str: ... - - @property - def int(self) -> Int: ... - - @property - def node(self) -> Int: ... - - @property - def time(self) -> Int: ... - - @property - def time_hi_version(self) -> Int: ... - - @property - def time_low(self) -> Int: ... - - @property - def time_mid(self) -> Int: ... - - @property - def urn(self) -> str: ... - - @property - def variant(self) -> str: ... - - @property - def version(self) -> str: ... - -def getnode() -> Int: ... -def uuid1(node: Int=..., clock_seq: Int=...) -> UUID: ... -def uuid3(namespace: UUID, name: str) -> UUID: ... -def uuid4() -> UUID: ... -def uuid5(namespace: UUID, name: str) -> UUID: ... - -NAMESPACE_DNS = ... # type: UUID -NAMESPACE_URL = ... # type: UUID -NAMESPACE_OID = ... # type: UUID -NAMESPACE_X500 = ... # type: UUID -RESERVED_NCS = ... # type: str -RFC_4122 = ... # type: str -RESERVED_MICROSOFT = ... # type: str -RESERVED_FUTURE = ... # type: str