On 4/17/07, Jean-Paul Calderone <exarkun at divmod.com> wrote: > > I just noticed r53997 (from some unit tests it broke), which disallowed > things > like this: > > class X(object): > def __repr__(self): > return "blah" > > class Y(X, type): > pass > > class Z: > __metaclass__ = Y > > Making X classic eliminates the TypeError, and is probably an acceptable > fix > in a lot of cases (at least as long as classic classes are available). I > wonder if the ability to override type special methods like this was > considered > when the change was made, though? Probably not, or at least not consciously. I think the point is that 'type' and its subclasses are special enough that this warrants a separate 'X' that inherits from 'type' rather than 'object'. Reduced reusability, but how badly does this affect you in the real world, really? -- Thomas Wouters <thomas at python.org> Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20070420/ed0c6bef/attachment.html
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4