<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Python’s super() considered super!</title>
	<atom:link href="http://rhettinger.wordpress.com/2011/05/26/super-considered-super/feed/" rel="self" type="application/rss+xml" />
	<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/</link>
	<description>Ruminations on Computers, Programming and Life</description>
	<lastBuildDate>Fri, 11 Jan 2013 16:56:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: iguananaut</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-117</link>
		<dc:creator><![CDATA[iguananaut]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 16:56:49 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-117</guid>
		<description><![CDATA[Re: &quot;Explicit is better than implicit&quot;--Although the semantics of calling super() in Python 3 are not explicit about the superclass an instance object it&#039;s still at least well-defined and consistent. Likewise for the MRO.  So as long as you understand the rules (which are not really all that complex at the end of the day) it&#039;s at least predictable.]]></description>
		<content:encoded><![CDATA[<p>Re: &#8220;Explicit is better than implicit&#8221;&#8211;Although the semantics of calling super() in Python 3 are not explicit about the superclass an instance object it&#8217;s still at least well-defined and consistent. Likewise for the MRO.  So as long as you understand the rules (which are not really all that complex at the end of the day) it&#8217;s at least predictable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Python&#8217;s super() &#124; blog.notmet.net</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-109</link>
		<dc:creator><![CDATA[Python&#8217;s super() &#124; blog.notmet.net]]></dc:creator>
		<pubDate>Fri, 05 Oct 2012 14:17:50 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-109</guid>
		<description><![CDATA[[...] when you&#8217;re using Python for object oriented code and have some inheritance going on.  This blog post describes the best way I&#8217;ve seen it used so [...]]]></description>
		<content:encoded><![CDATA[<p>[...] when you&#8217;re using Python for object oriented code and have some inheritance going on.  This blog post describes the best way I&#8217;ve seen it used so [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rhettinger</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-104</link>
		<dc:creator><![CDATA[rhettinger]]></dc:creator>
		<pubDate>Thu, 06 Sep 2012 06:26:14 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-104</guid>
		<description><![CDATA[Yes, you&#039;re correct.   The Counter.__init__ method will be the first __init__ encountered in the MRO.  The code in Counter.__init__ calls super which finds OrderedDict.__init__ as the next in the MRO.]]></description>
		<content:encoded><![CDATA[<p>Yes, you&#8217;re correct.   The Counter.__init__ method will be the first __init__ encountered in the MRO.  The code in Counter.__init__ calls super which finds OrderedDict.__init__ as the next in the MRO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nielshenrikbruun</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-101</link>
		<dc:creator><![CDATA[nielshenrikbruun]]></dc:creator>
		<pubDate>Sun, 02 Sep 2012 04:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-101</guid>
		<description><![CDATA[Hi
I\’ve started using classes and subclasses etc for some time now.
And in lack of documentation I\’d do some trail and error when starting.

In my code I usually reuse methods in a class to define new methods, ie I define some base methods that might be used to create more complicated functionality in new methods.

In doing so I\’ve found that using self much like super() is used (I wasn\’t aware of super()) did the job for me.

class Example:
def basemethod1(self):
pass
def basemethod2(self):
pass
def advancedmethod1(self):
refers to self.basemethod1() and/or self.basemethod1()

And it also works when subclassing.

The question is whether the above is proper code or not?
Or if I should use super instead?
what are the pros and cons in self vs super()?

Looking forward to your answer]]></description>
		<content:encoded><![CDATA[<p>Hi<br />
I\’ve started using classes and subclasses etc for some time now.<br />
And in lack of documentation I\’d do some trail and error when starting.</p>
<p>In my code I usually reuse methods in a class to define new methods, ie I define some base methods that might be used to create more complicated functionality in new methods.</p>
<p>In doing so I\’ve found that using self much like super() is used (I wasn\’t aware of super()) did the job for me.</p>
<p>class Example:<br />
def basemethod1(self):<br />
pass<br />
def basemethod2(self):<br />
pass<br />
def advancedmethod1(self):<br />
refers to self.basemethod1() and/or self.basemethod1()</p>
<p>And it also works when subclassing.</p>
<p>The question is whether the above is proper code or not?<br />
Or if I should use super instead?<br />
what are the pros and cons in self vs super()?</p>
<p>Looking forward to your answer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh Sahu</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-97</link>
		<dc:creator><![CDATA[Ramesh Sahu]]></dc:creator>
		<pubDate>Wed, 08 Aug 2012 11:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-97</guid>
		<description><![CDATA[Thank you very much for taking the time to write this post. It is very informative..]]></description>
		<content:encoded><![CDATA[<p>Thank you very much for taking the time to write this post. It is very informative..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lvc</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-93</link>
		<dc:creator><![CDATA[lvc]]></dc:creator>
		<pubDate>Sun, 20 May 2012 02:34:26 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-93</guid>
		<description><![CDATA[There&#039;s no way around having to know the signature of a parent class&#039; constructor in order to call the parent class&#039; constructor (aside from the technique mentioned in the post of accepting arbitrary kwargs, taking out the ones you can deal with, and passing the rest along). This problem isn&#039;t unique to Python - Java and C++ convention have you always declare a constructor that can be called with no arguments.]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s no way around having to know the signature of a parent class&#8217; constructor in order to call the parent class&#8217; constructor (aside from the technique mentioned in the post of accepting arbitrary kwargs, taking out the ones you can deal with, and passing the rest along). This problem isn&#8217;t unique to Python &#8211; Java and C++ convention have you always declare a constructor that can be called with no arguments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Knechtel</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-86</link>
		<dc:creator><![CDATA[Karl Knechtel]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 00:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-86</guid>
		<description><![CDATA[Regarding the (Counter, OrderedDict) example: when the OrderedCounter is initialized or updated, the Counter __init__ (or update) is run because that&#039;s the next class in the MRO, right? So how does the OrderedDict behaviour get triggered? Is Counter making a super() call somewhere that gets routed through OrderedDict (instead of passing directly to the builtin dict type as it normally would)? Or just what?]]></description>
		<content:encoded><![CDATA[<p>Regarding the (Counter, OrderedDict) example: when the OrderedCounter is initialized or updated, the Counter __init__ (or update) is run because that&#8217;s the next class in the MRO, right? So how does the OrderedDict behaviour get triggered? Is Counter making a super() call somewhere that gets routed through OrderedDict (instead of passing directly to the builtin dict type as it normally would)? Or just what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Snooze</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-85</link>
		<dc:creator><![CDATA[Snooze]]></dc:creator>
		<pubDate>Sun, 11 Mar 2012 22:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-85</guid>
		<description><![CDATA[Thank you for the great post.

I get how python handles multiple class inheritance now, but I still don&#039;t quite understand what you meant by this paragraph:

&quot;Root.draw can also employ defensive programming using an assertion to ensure it isn’t masking some other draw() method later in the chain.  This could happen if a subclass erroneously incorporates a class that has a draw() method but doesn’t inherit from Root.&quot;

I can understand how the assertion would fail if Root inherited from another class, but we know that Root doesn&#039;t because we wrote it ourselves.

I don&#039;t quite understand how the assertion in Root will be called if the subclass in question doesn&#039;t inherit from Root. Maybe you can show how such an inheritance tree would be structured?]]></description>
		<content:encoded><![CDATA[<p>Thank you for the great post.</p>
<p>I get how python handles multiple class inheritance now, but I still don&#8217;t quite understand what you meant by this paragraph:</p>
<p>&#8220;Root.draw can also employ defensive programming using an assertion to ensure it isn’t masking some other draw() method later in the chain.  This could happen if a subclass erroneously incorporates a class that has a draw() method but doesn’t inherit from Root.&#8221;</p>
<p>I can understand how the assertion would fail if Root inherited from another class, but we know that Root doesn&#8217;t because we wrote it ourselves.</p>
<p>I don&#8217;t quite understand how the assertion in Root will be called if the subclass in question doesn&#8217;t inherit from Root. Maybe you can show how such an inheritance tree would be structured?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedle Zelnip</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-82</link>
		<dc:creator><![CDATA[Pedle Zelnip]]></dc:creator>
		<pubDate>Tue, 06 Mar 2012 17:12:37 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-82</guid>
		<description><![CDATA[My apologies, I missed the How to Incorporate a Non-cooperative Class section on my 1st read somehow. :)

&quot;Oh, I wish that unrelated third-party classes composed together effortlessly and magically happened to do exactly the behavior I want without me every bothering to specify (or think about) what that behavior should be or how it would work.”

That&#039;s a strawman right there.  All I&#039;m saying is that there should be a consistent, safe mechanism for calling parent class constructor&#039;s.  super() isn&#039;t it, as it requires knowledge of how a class was defined in order to know how to call it&#039;s constructor.]]></description>
		<content:encoded><![CDATA[<p>My apologies, I missed the How to Incorporate a Non-cooperative Class section on my 1st read somehow. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8220;Oh, I wish that unrelated third-party classes composed together effortlessly and magically happened to do exactly the behavior I want without me every bothering to specify (or think about) what that behavior should be or how it would work.”</p>
<p>That&#8217;s a strawman right there.  All I&#8217;m saying is that there should be a consistent, safe mechanism for calling parent class constructor&#8217;s.  super() isn&#8217;t it, as it requires knowledge of how a class was defined in order to know how to call it&#8217;s constructor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rhettinger</title>
		<link>http://rhettinger.wordpress.com/2011/05/26/super-considered-super/#comment-81</link>
		<dc:creator><![CDATA[rhettinger]]></dc:creator>
		<pubDate>Mon, 05 Mar 2012 23:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://rhettinger.wordpress.com/?p=134#comment-81</guid>
		<description><![CDATA[The article shows how to create a wrapper for third-party classes that were not designed for cooperative multiple inheritance.  

Calling it a &quot;fundamentally broken solution&quot; is a red-herring.  The solution is based on a good deal of academic research (plus real-world experience with the Dylan programming language).  The underlying problem is non-trivial -- care and forethought are required for freely composeable classes using multiple inheritance while allowing for diamond patterns.  

There is a reason that the style is called cooperative multiple inheritance.  The classes either need to be &lt;strong&gt;designed&lt;/strong&gt; cooperatively or they need to be wrapped to make them cooperative.  Anything else equates to wishful thinking -- &quot;Oh, I wish that unrelated third-party classes composed together effortlessly and magically happened to do exactly the behavior I want without me every bothering to specify (or think about) what that behavior should be or how it would work.&quot;]]></description>
		<content:encoded><![CDATA[<p>The article shows how to create a wrapper for third-party classes that were not designed for cooperative multiple inheritance.  </p>
<p>Calling it a &#8220;fundamentally broken solution&#8221; is a red-herring.  The solution is based on a good deal of academic research (plus real-world experience with the Dylan programming language).  The underlying problem is non-trivial &#8212; care and forethought are required for freely composeable classes using multiple inheritance while allowing for diamond patterns.  </p>
<p>There is a reason that the style is called cooperative multiple inheritance.  The classes either need to be <strong>designed</strong> cooperatively or they need to be wrapped to make them cooperative.  Anything else equates to wishful thinking &#8212; &#8220;Oh, I wish that unrelated third-party classes composed together effortlessly and magically happened to do exactly the behavior I want without me every bothering to specify (or think about) what that behavior should be or how it would work.&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
