New submission from Tzach Yarimi <tzach...@gmail.com>:

Primitives usually accept an instance of their own type in the constructor, for 
example:

int(5)
str("a")
tuple((1,2,3))

This is not the case for UUID:
>>> from uuid import uuid4, UUID
>>> x = uuid4()
>>> UUID(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/uuid.py",
 line 168, in __init__
    hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'UUID' object has no attribute 'replace'

----------

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

Reply via email to