<?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/"
		>
<channel>
	<title>Comments on: Monstrous polymorphism and a Python post-import hook decorator</title>
	<atom:link href="http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/</link>
	<description>__author__ = &#039;Chris Leary&#039;</description>
	<lastBuildDate>Mon, 06 Sep 2010 19:31:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Susan Bradley</title>
		<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/comment-page-1/#comment-1460</link>
		<dc:creator>Susan Bradley</dc:creator>
		<pubDate>Sat, 06 Mar 2010 23:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=521#comment-1460</guid>
		<description>Cool Thanks for the article. I am just starting python and this is a big help.</description>
		<content:encoded><![CDATA[<p>Cool Thanks for the article. I am just starting python and this is a big help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Leary</title>
		<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/comment-page-1/#comment-1236</link>
		<dc:creator>Christopher Leary</dc:creator>
		<pubDate>Wed, 23 Sep 2009 07:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=521#comment-1236</guid>
		<description>@rgz: Yes, it&#039;s possible to hold opinions for whole subtrees in the class hierarchy (as &lt;tt&gt;instanceof&lt;/tt&gt; based code does), but that still doesn&#039;t help you in the case that a new subclass is created off the Monster base class!

As Yegge mentions in that blog entry, the solution to this is to either create a) a default behavior or b) do some reflection on all the classes you can enumerate in the system and figure out whether there&#039;s something about them you like. The latter can be accomplished in more dynamic languages (which is the case I cover above).</description>
		<content:encoded><![CDATA[<p>@rgz: Yes, it&#8217;s possible to hold opinions for whole subtrees in the class hierarchy (as <tt>instanceof</tt> based code does), but that still doesn&#8217;t help you in the case that a new subclass is created off the Monster base class!</p>
<p>As Yegge mentions in that blog entry, the solution to this is to either create a) a default behavior or b) do some reflection on all the classes you can enumerate in the system and figure out whether there&#8217;s something about them you like. The latter can be accomplished in more dynamic languages (which is the case I cover above).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rgz</title>
		<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/comment-page-1/#comment-1235</link>
		<dc:creator>rgz</dc:creator>
		<pubDate>Wed, 23 Sep 2009 07:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=521#comment-1235</guid>
		<description>Actually I think Mr. Elf opinions are relevant only to himself and Monster classes shouldn&#039;t be extended to support his opinions. Rather to allow the Mr. Elf to hold opinions over random Monsters of variable, lazy loaded, or user developed classes have Mr. Elf hold opinions over class hierarchies.

If Mr. Elf lacks an opinion about &lt;__main__.RedMountainOrc object at 0x904ebcc&gt; he should just remember he hates all MountainOrc from which RedMountainOrc is derived.</description>
		<content:encoded><![CDATA[<p>Actually I think Mr. Elf opinions are relevant only to himself and Monster classes shouldn&#8217;t be extended to support his opinions. Rather to allow the Mr. Elf to hold opinions over random Monsters of variable, lazy loaded, or user developed classes have Mr. Elf hold opinions over class hierarchies.</p>
<p>If Mr. Elf lacks an opinion about &lt;__main__.RedMountainOrc object at 0x904ebcc&gt; he should just remember he hates all MountainOrc from which RedMountainOrc is derived.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VaporWarning&#187; Blog Archive &#187; Registry pattern trumps import magic</title>
		<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/comment-page-1/#comment-1115</link>
		<dc:creator>VaporWarning&#187; Blog Archive &#187; Registry pattern trumps import magic</dc:creator>
		<pubDate>Mon, 01 Jun 2009 19:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=521#comment-1115</guid>
		<description>[...] demonstrated by Marius&#8217; comment in my last entry, Python coders have a healthy respect for the power of late binding, arbitrary [...]</description>
		<content:encoded><![CDATA[<div style="background-color: #fafad2;">
<p>[...] demonstrated by Marius&#8217; comment in my last entry, Python coders have a healthy respect for the power of late binding, arbitrary [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius Gedminas</title>
		<link>http://blog.cdleary.com/2009/04/monstrous-polymorphism-and-a-python-post-import-hook-decorator/comment-page-1/#comment-1066</link>
		<dc:creator>Marius Gedminas</dc:creator>
		<pubDate>Fri, 17 Apr 2009 21:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=521#comment-1066</guid>
		<description>A very interesting example.   While I get that you&#039;re only doing this as an intellectual excercise, it never hurts repeating that it&#039;s a bit frivolous and silly and nobody should actually use it in a real project.

I&#039;m not aiming the following at you, but at your other readers: Monkey-patching is frowned upon in Python; if you want to add extra functionality to existing classes, using something like adapters from zope.component is a better alternative.</description>
		<content:encoded><![CDATA[<p>A very interesting example.   While I get that you&#8217;re only doing this as an intellectual excercise, it never hurts repeating that it&#8217;s a bit frivolous and silly and nobody should actually use it in a real project.</p>
<p>I&#8217;m not aiming the following at you, but at your other readers: Monkey-patching is frowned upon in Python; if you want to add extra functionality to existing classes, using something like adapters from zope.component is a better alternative.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
