<?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: Replacing twisted if/else statements in Python&#8230;</title>
	<atom:link href="http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 10 May 2010 15:39:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Harry</title>
		<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/comment-page-1/#comment-11</link>
		<dc:creator>Harry</dc:creator>
		<pubDate>Tue, 15 Dec 2009 01:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.geekymedia.com/?p=26#comment-11</guid>
		<description>What Have The Romans Ever Done For Us, Eh ? ? ?</description>
		<content:encoded><![CDATA[<p>What Have The Romans Ever Done For Us, Eh ? ? ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizwan Kassim</title>
		<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/comment-page-1/#comment-5</link>
		<dc:creator>Rizwan Kassim</dc:creator>
		<pubDate>Thu, 26 Nov 2009 20:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.geekymedia.com/?p=26#comment-5</guid>
		<description>yeah, I&#039;d do Flash first too, given your work. But Python makes me giddy and happy to code again - it&#039;s been a while since I&#039;ve had that.</description>
		<content:encoded><![CDATA[<p>yeah, I&#8217;d do Flash first too, given your work. But Python makes me giddy and happy to code again &#8211; it&#8217;s been a while since I&#8217;ve had that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/comment-page-1/#comment-4</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Thu, 26 Nov 2009 08:50:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.geekymedia.com/?p=26#comment-4</guid>
		<description>If you&#039;re actually doing it as indicated - i.e., pulling your function names from an array, as opposed to from user input or the database - I don&#039;t see why it&#039;s any more dangerous than your method.

I do need to learn Python though.  However, due to the needs of my job, it&#039;s lower on my list than Flash.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re actually doing it as indicated &#8211; i.e., pulling your function names from an array, as opposed to from user input or the database &#8211; I don&#8217;t see why it&#8217;s any more dangerous than your method.</p>
<p>I do need to learn Python though.  However, due to the needs of my job, it&#8217;s lower on my list than Flash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizwan Kassim</title>
		<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/comment-page-1/#comment-3</link>
		<dc:creator>Rizwan Kassim</dc:creator>
		<pubDate>Wed, 25 Nov 2009 19:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.geekymedia.com/?p=26#comment-3</guid>
		<description>Yeah, fair pait. Eval&#039;s dangerous though --- given it&#039;s dangerous, would you actually do it that way, or do you if/then/else?

Python&#039;s culture is very much about clean and elegant code - I do love that I stop and think of the quality of my code a lot more when writing Python, because there&#039;s the culture of Pythonic code... And, of course, &lt;a href=&quot;http://www.python.org/dev/peps/pep-0020/&quot; rel=&quot;nofollow&quot;&gt;import this&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Yeah, fair pait. Eval&#8217;s dangerous though &#8212; given it&#8217;s dangerous, would you actually do it that way, or do you if/then/else?</p>
<p>Python&#8217;s culture is very much about clean and elegant code &#8211; I do love that I stop and think of the quality of my code a lot more when writing Python, because there&#8217;s the culture of Pythonic code&#8230; And, of course, <a href="http://www.python.org/dev/peps/pep-0020/" rel="nofollow">import this</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.geekymedia.com/tech-articles/replacing-twisted-ifelse-statements-in-python/comment-page-1/#comment-2</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Wed, 25 Nov 2009 03:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.geekymedia.com/?p=26#comment-2</guid>
		<description>Nice.  In PHP I would solve it with the eval() function:

$lookup = array(&#039;Vendor1&#039; =&gt; &#039;Vendor1&#039;, &#039;Vendor2&#039; =&gt; &#039;Vendor2&#039;, &#039;Vendor3&#039; =&gt; &#039;Vendor3&#039;);

$foo = in_array($object_type, $lookup) ? eval($lookup[$object_type]) : false;</description>
		<content:encoded><![CDATA[<p>Nice.  In PHP I would solve it with the eval() function:</p>
<p>$lookup = array(&#8216;Vendor1&#8242; =&gt; &#8216;Vendor1&#8242;, &#8216;Vendor2&#8242; =&gt; &#8216;Vendor2&#8242;, &#8216;Vendor3&#8242; =&gt; &#8216;Vendor3&#8242;);</p>
<p>$foo = in_array($object_type, $lookup) ? eval($lookup[$object_type]) : false;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
