Message305635
"""
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 :-) |
|
Date |
User |
Action |
Args |
2017-11-06 11:27:45 | vstinner | set | recipients:
+ vstinner, orsenthil, kdart, pitrou, christian.heimes, ned.deily, eric.araujo, Arfrever, r.david.murray, methane, skrah, nvetoshkin, lukasz.langa, knny-myer, nailor, Keith.Dart, berker.peksag, hynek, martin.panter, serhiy.storchaka, Michael.Felt, aixtools@gmail.com |
2017-11-06 11:27:44 | vstinner | set | messageid: <1509967664.14.0.213398074469.issue11063@psf.upfronthosting.co.za> |
2017-11-06 11:27:44 | vstinner | link | issue11063 messages |
2017-11-06 11:27:44 | vstinner | create | |
|