Updated blog post on how to use super()

Raymond Hettinger python at rcn.com
Tue May 31 22:44:07 EDT 2011


I've tightened the wording a bit, made much better use of keyword
arguments instead of kwds.pop(arg), and added a section on defensive
programming (protecting a subclass from inadvertently missing an MRO
requirement).  Also, there is an entry on how to use assertions to
validate search order requirements and make them explicit.

  http://bit.ly/py_super
     or
  http://rhettinger.wordpress.com/2011/05/26/super-considered-super/

Any further suggestions are welcome.  I'm expecting this to evolve
into how-to guide to be included in the regular Python standard
documentation.  The goal is to serve as a reliable guide to using
super and how to design cooperative classes in a way that lets
subclasses compose and extent them.


Raymond Hettinger

--------
follow my python tips on twitter: @raymondh



More information about the Python-list mailing list