[issue30977] reduce uuid.UUID() memory footprint

wouter bolsterlee report at bugs.python.org
Fri Jul 21 04:57:53 EDT 2017


wouter bolsterlee added the comment:

i consider uuids as low level data types, not as fancy containers, similar to how i view datetime objects. given the native support in e.g. postgresql and many other systems, it's common to deal with uuids.

of course you can convert to/from strings or numbers, but that is cumbersome in many cases. for comparison, one would typically not convert unicode text from/into utf-8 encoded byte strings either, even though the latter will save memory in many cases.

from experience: converting can lead to nasty bugs, e.g. because you forgot about a conversion, and then a uuid string does not compare equal to a uuid.UUID instance, leaving you puzzled.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30977>
_______________________________________


More information about the Python-bugs-list mailing list