Skip to content

Merge uuid module into 2and3 #1148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions stdlib/2/uuid.pyi

This file was deleted.

87 changes: 87 additions & 0 deletions stdlib/2and3/uuid.pyi
Original file line number Diff line number Diff line change
@@ -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
73 changes: 0 additions & 73 deletions stdlib/3/uuid.pyi

This file was deleted.