<?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: Constantize in Python</title>
	<atom:link href="http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/</link>
	<description>Things that have more than zero impact (on my live)</description>
	<lastBuildDate>Wed, 02 May 2012 09:10:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Justin</title>
		<link>http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7048</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Thu, 17 Dec 2009 01:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7048</guid>
		<description>well, being able to obtain a reference to an object in the global namespace using its name as a string is orthogonal to deciding what you want to do with it. I was just providing a better alternative to using regular expressions and eval().

you could easily maintain a whitelist of names that you will allow lookups for. i.e.

whitelist = [&#039;A&#039;,&#039;B&#039;]

def str2class(str):
   return str in whitelist and globals()[str]</description>
		<content:encoded><![CDATA[<p>well, being able to obtain a reference to an object in the global namespace using its name as a string is orthogonal to deciding what you want to do with it. I was just providing a better alternative to using regular expressions and eval().</p>
<p>you could easily maintain a whitelist of names that you will allow lookups for. i.e.</p>
<p>whitelist = ['A','B']</p>
<p>def str2class(str):<br />
   return str in whitelist and globals()[str]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henryk</title>
		<link>http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7046</link>
		<dc:creator>Henryk</dc:creator>
		<pubDate>Wed, 16 Dec 2009 23:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7046</guid>
		<description>@Justin
Thank you for your comment. Your proposition looks better than an &quot;eval&quot;,
but you still need to check whether the class is &quot;allowed&quot;.</description>
		<content:encoded><![CDATA[<p>@Justin<br />
Thank you for your comment. Your proposition looks better than an &#034;eval&#034;,<br />
but you still need to check whether the class is &#034;allowed&#034;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7043</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 16 Dec 2009 21:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-7043</guid>
		<description>or you could just use globals()[&quot;MyClass&quot;]</description>
		<content:encoded><![CDATA[<p>or you could just use globals()["MyClass"]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Little Impact &#187; Blog Archive &#187; Constantize with Care</title>
		<link>http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-4763</link>
		<dc:creator>Little Impact &#187; Blog Archive &#187; Constantize with Care</dc:creator>
		<pubDate>Tue, 15 Sep 2009 11:53:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.littleimpact.de/index.php/2009/02/08/constantize-in-python/#comment-4763</guid>
		<description>[...] I also have some notes on Constantize in Python.   Share and [...]</description>
		<content:encoded><![CDATA[<p>[...] I also have some notes on Constantize in Python.   Share and [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

