[issue11854] __or__ et al instantiate subclass of set without calling __init__

Raymond Hettinger report at bugs.python.org
Sun Apr 17 04:33:33 CEST 2011


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

2.6 is closed for anything except security patches at this point.

2.7 is only open for flat-out bugs, not API changes.  So, we might be able to add code that could call the __init__ method (if it exists) whenever a new set is created, but we couldn't change whether __or__ returns a new set or frozenset instead of one of its subtypes.  Existing, working code may reasonably rely on the current behavior of returning the subtype (FWIW, this also matches what was done in the original sets.py).

----------

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


More information about the Python-bugs-list mailing list