uuid.int_
Prev: uuid.getnode | Up: uuid | Next: uuid.main
Rel: uuid.bytes_, uuid.Enum, uuid.getnode, uuid.main
Ref: docs.python.org — uuid.int_
Tags: #public #python3 #stdlib #uuid
Import
import uuid
from uuid import int_
Signature & Overview
uuid.int_(...)
int(x, base=10) -> integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point
Methods & Attributes
int_.as_integer_ratio(self, /)— Return a pair of integers, whose ratio is equal to the original int.int_.bit_count(self, /)— Number of ones in the binary representation of the absolute value of self.int_.bit_length(self, /)— Number of bits necessary to represent self in binary.int_.conjugate(self, /)— Returns self, the complex conjugate of any int.int_.from_bytes(bytes, byteorder='big', *, signed=False)— Return the integer represented by the given array of bytes.int_.is_integer(self, /)— Returns True. Exists for duck type compatibility with float.is_integer.int_.to_bytes(self, /, length=1, byteorder='big', *, signed=False)— Return an array of bytes representing an integer.
Usage
import uuid
# Pass int= to uuid.UUID(int=n)
assert uuid.UUID(int=0) == uuid.UUID('00000000-0000-0000-0000-000000000000')
Gotchas
- 128-bit unsigned integer representation.
REPL Inspect
from uuid import int_
help(int_)
Linked from
- tuts/python3/stdlib_module/uuid
- tuts/python3/stdlib_module/uuid/bytes_
- tuts/python3/stdlib_module/uuid/Enum
- tuts/python3/stdlib_module/uuid/getnode
- tuts/python3/stdlib_module/uuid/main
- tuts/python3/stdlib_module/uuid/SafeUUID
- tuts/python3/stdlib_module/uuid/UUID
- tuts/python3/stdlib_module/uuid/uuid1
- tuts/python3/stdlib_module/uuid/uuid3
- tuts/python3/stdlib_module/uuid/uuid4
- tuts/python3/stdlib_module/uuid/uuid5
- tuts/python3/stdlib_module/uuid/uuid6
- tuts/python3/stdlib_module/uuid/uuid7
- tuts/python3/stdlib_module/uuid/uuid8
Related notes
- tuts/python3/stdlib_module/uuid/bytes_ Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/Enum Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/getnode Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/main Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/UUID Linked here; links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/SafeUUID links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid1 links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid3 links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid4 links to this page; shared tags: #stdlib, #uuid
- tuts/python3/stdlib_module/uuid/uuid5 links to this page; shared tags: #stdlib, #uuid