
Fred reported that super objects don't respond well to language constructs that bypass attribute lookup. For example, supobj.__setitem__(name,value) works if __setitem__() is defined in the target, but supobj[name]=value will raise a TypeError. www.python.org/sf/805304 Once the fix is approved, there is a question of whether it should be backported. The case against it is that some programs written under Py2.3.1 or Py2.2.4 won't run on Py2.3.0 or Py2.2.3 and the patch can be viewed as an API expansion. The other point of view is that super objects should have always behaved this way and that the patch just fixes buggy behavior. Raymond

"Raymond Hettinger" <raymond.hettinger@verizon.net> writes:
Once the fix is approved, there is a question of whether it should be backported. The case against it is that some programs written under Py2.3.1 or Py2.2.4 won't run on Py2.3.0 or Py2.2.3 and the patch can be viewed as an API expansion. The other point of view is that super objects should have always behaved this way and that the patch just fixes buggy behavior.
Whether it is a bug or not can be best clarified by looking at the documentation: If it is documented that attributes of super objects always follow MRO, then there is a bug. That might be a doc bug, but Special cases aren't special enough to break the rules. makes clear it wouldn't be a doc bug, but a bug in the code. OTOH, if this is not documented at all, you clearly have a doc bug. Regards, Martin
participants (2)
-
martin@v.loewis.de
-
Raymond Hettinger