<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Dynamic Method Creation in Python</title>
	<link>http://www.terminally-incoherent.com/blog/2008/06/30/dynamic-method-creation-in-python/</link>
	<description>Utterly random, incoherent and disjointed rants and ramblings...</description>
	<pubDate>Fri, 05 Dec 2008 00:17:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: ido</title>
		<link>http://www.terminally-incoherent.com/blog/2008/06/30/dynamic-method-creation-in-python/#comment-9498</link>
		<pubDate>Tue, 01 Jul 2008 08:29:42 +0000</pubDate>
		<guid>http://www.terminally-incoherent.com/blog/2008/06/30/dynamic-method-creation-in-python/#comment-9498</guid>
					<description>you could use the hybrid version:
&lt;code&gt;
&#62;&#62;&#62; def printf(s, *args):
...     print s % args
...
&#62;&#62;&#62; Person.bar = lambda p: printf("foo") if p.fname &#62; p.lname else printf("bar")
&#62;&#62;&#62; john.bar()
bar
&lt;/code&gt;

just stick printf into a common import file, and use it whenever you need to avoid statements

oh, and I thought you would like this:
Sales Guy vs. Web Dude
http://blip.tv/file/1015028
:)</description>
		<content:encoded><![CDATA[<p>you could use the hybrid version:<br />
<code><br />
&gt;&gt;&gt; def printf(s, *args):<br />
...     print s % args<br />
...<br />
&gt;&gt;&gt; Person.bar = lambda p: printf("foo") if p.fname &gt; p.lname else printf("bar")<br />
&gt;&gt;&gt; john.bar()<br />
bar<br />
</code></p>
<p>just stick printf into a common import file, and use it whenever you need to avoid statements</p>
<p>oh, and I thought you would like this:<br />
Sales Guy vs. Web Dude<br />
<a href="http://blip.tv/file/1015028" rel="nofollow">http://blip.tv/file/1015028</a><br />
:)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.409 seconds -->
