Skip to content

Commit 54e040a

Browse files
1st1picnixz
andcommitted
Apply batched suggestions from code review
Apply review suggestions Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Yury Selivanov <yselivanov@gmail.com>
1 parent 0802f7b commit 54e040a

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎Doc/library/uuid.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ which relays any information about the UUID's safety, using this enumeration:
6969
variant and version number set according to :rfc:`9562`, overriding bits in the
7070
given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
7171

72-
.. versionchanged:: 3.16
72+
.. versionchanged:: next
7373
Passing an object other than :class:`bytes` as *bytes* or *bytes_le*
7474
now consistently raises :exc:`TypeError`. Previously, some invalid inputs
7575
raised :exc:`AssertionError` or :exc:`ValueError`.

‎Lib/uuid.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def uuid6(node=None, clock_seq=None):
864864
_last_counter_v7 = 0 # 42-bit counter
865865

866866
def _uuid7_get_counter_and_tail():
867-
rand = int.from_bytes(_gen_random(10), 'big')
867+
rand = int.from_bytes(_gen_random(10))
868868

869869
# 42-bit counter with MSB set to 0
870870
counter = (rand >> 32) & 0x1ff_ffff_ffff
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Reimplement base UUID type, uuid4(), and uuid7() in C
2-
1+
:mod:`uuid`: Reimplement :class:`~uuid.UUID` objects, :func:`~uuid.uuid4`,
2+
and :func:`~uuid.uuid7` in C.

‎Modules/_uuidmodule.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,12 +1830,11 @@ uuid_exec(PyObject *module)
18301830

18311831
#undef ADD_INT
18321832

1833-
state->uuid_type = (PyTypeObject *)PyType_FromMetaclass(
1834-
NULL,
1835-
module,
1836-
&Uuid_spec,
1837-
NULL
1838-
);
1833+
state->uuid_type = (PyTypeObject *)PyType_FromModuleAndSpec(
1834+
module,
1835+
&Uuid_spec,
1836+
NULL
1837+
);
18391838
if (state->uuid_type == NULL) {
18401839
return -1;
18411840
}

0 commit comments

Comments
 (0)