STINNER Victor <[email protected]> added the comment:
"""
Unrelated to the patch (same before and after), this looks odd to me:
>>> import uuid
>>> uuid._has_uuid_generate_time_safe is None
True
>>>
>>> import _uuid
>>> _uuid.has_uuid_generate_time_safe
1
"""
None means "not initialized yet". It's initialized on demand, at the first call
of uuid1() or get_node():
$ python3
Python 3.7.0a2+ (heads/master:a5293b4ff2, Nov 6 2017, 12:22:04)
>>> import uuid
>>> uuid._has_uuid_generate_time_safe # == None
>>> uuid.uuid1()
UUID('3e5a7628-c2e5-11e7-adc1-3ca9f4650c0c')
>>> uuid._has_uuid_generate_time_safe
1
> [Also, I thought we weren't supposed to use ctypes in the stdlib.]
Antoine's commit a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 avoids ctypes when
libuuid is available.
For the other systems without libuuid, well, it was probably simpler to use
ctypes. ctypes was more popular a few years ago. The code "just works" and I
guess that nobody wants to touch it :-)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue11063>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com