Tal Einat <taleinat+pyt...@gmail.com> added the comment:

The uuid module is likely used on a huge variety of operating systems and 
hardware; I feel making UUID.__init__() reject values which it accepted until 
now would unnecessarily break existing code.  While raising an exception in 
__init__ seems more natural and correct in theory, it is also a larger break in 
backwards-compatibility.

I'm specifically worried by the _windll() example in PR GH-9417, in which a 
non-RFC 4122 conforming UUID is created, leading to the addition of the new 
"strict" keyword argument so that we can disable the new check in __init__ in 
this case.  There's a good chance that there are other such scenarios of which 
we're simply not yet aware.

In light of this, returning None for UUID.version, as in PR GH-9413, actually 
seems like a very reasonable solution.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34732>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to