On Tue, May 31, 2011 at 8:44 PM, Raymond Hettinger <pyt...@rcn.com> wrote:
> 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 > -- > http://mail.python.org/mailman/listinfo/python-list > I would recommend a more constructive introduction that has less meta-analysis of what the post is about and just digs in. *If you aren’t wowed by Python’s super() builtin, chances are you don’t really know what it is capable of doing or how to use it effectively.* This strikes me as a thinly veiled dis.. *Much has been written about super() and much of that writing has been a failure. * I'm having a hard time seeing how this supremely condescending bit is helpful? If *your* writing is not a failure time will tell. * This article seeks to improve on the situation by: - providing practical use cases - giving a clear mental model of how it works - showing the tradecraft for getting it to work every time - concrete advice for building classes that use super() - solutions to common issues - favoring real examples over abstract ABCD diamond diagrams<http://en.wikipedia.org/wiki/Diamond_problem> . * These strikes me as notes by the author for the author. You could easily extract the gist of the above points and convert them into a sentence or two. Overall, take everything up to the end of the last bullet point and convert it into a 2-3 sentence intro paragraph. -- Brian Mingus Graduate student Computational Cognitive Neuroscience Lab University of Colorado at Boulder
-- http://mail.python.org/mailman/listinfo/python-list