[issue12248] __dir__ semantics changed in Python 2.7.2

Nick Coghlan report at bugs.python.org
Sat Jun 4 04:26:32 CEST 2011

Nick Coghlan <ncoghlan at gmail.com> added the comment:

It would be broken in the same way that it was broken in 2.7.1 though. That can be a plus when it comes to maintenance releases.

OTOH, this does turn a silent failure (__dir__() ignored on old-style classes) into a noisy failure (must return a list).

If you make Barry's classes new-style, they break in 2.7.1 as well, so I'm coming around to a point of view that this is a legitimate fix that reveals a real bug in third party code (i.e. anyone that hits this had a __dir__ that previously wasn't getting invoked)


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list