Josh Rosenberg <[email protected]> added the comment:
The UUID module documentation (and docstring) begin with:
"This module provides immutable UUID objects"
Immutable is a stronger guarantee than __slots__ enforces already, so the
documentation already ruled out adding arbitrary attributes to UUID (and the
__setattr__ that unconditionally raised TypeError('UUID objects are immutable')
supported that.
Given the behavior hasn't changed in any way that contradicts the docs, nor
would it affect anyone who wasn't intentionally working around the __setattr__
block, I don't feel a need to mention the arbitrary attribute limitation.
It's fine to leave in the What's New note (it is a meaningful memory savings
for applications using lots of UUIDs), but the note can simplify to just:
"""uuid.UUID now uses __slots__ to reduce its memory footprint."""
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35701>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com