[Python-Dev] python and super (original) (raw)

Giampaolo RodolĂ  g.rodola at gmail.com
Thu Apr 14 15:36:56 CEST 2011


:-)

2011/4/14 Antoine Pitrou <solipsis at pitrou.net>

On Thu, 14 Apr 2011 08:15:10 -0500 Benjamin Peterson <benjamin at python.org> wrote: > 2011/4/14 Ricardo Kirkner <ricardokirkner at gmail.com>: > > Hi all, > > > > I recently stumbled upon an issue with a class in the mro chain not > > calling super, therefore breaking the chain (ie, further base classes > > along the chain didn't get called). > > I understand it is currently a requirement that all classes that are > > part of the mro chain behave and always call super. My question is, > > shouldn't/wouldn't it be better, > > if python took ownership of that part, and ensured all classes get > > called, even if some class misbehaved? > > > > For example, if using a stack-like structure, pushing super calls and > > popping until the stack was empty, couldn't this restriction be > > removed? > > No. See line 2 of the Zen of Python.

You could have quoted it explicitly :) FWIW, line 2 is: Explicit is better than implicit. Regards Antoine.


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/g.rodola%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20110414/e0d1fbbc/attachment.html>



More information about the Python-Dev mailing list