Antti Haapala <[email protected]> added the comment:
I've been hit by this too, in similar contexts, and several times. It is really
annoying that it is easier to coerce an UUID or UUID-string to a string than to
coerce to a UUID. Usually when the copy semantics are clear and the class is
plain old data, Python lets you execute the constructor with an instance of the
same class:
>>> bytes(bytes())
b''
>>> bytearray(bytearray())
bytearray(b'')
>>> int(int())
0
>>> complex(complex())
0j
>>> tuple(tuple())
()
I don't to see why this shouldn't be true with UUID as well.
----------
nosy: +ztane
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32112>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com