<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: State code mappings for Python</title>
	<link>http://cmichae.acm.jhu.edu/blog/2006/12/29/state-code-mappings-for-python/</link>
	<description>Finance, Technology, Design, Photography and other things that interest me.</description>
	<pubDate>Mon, 23 Nov 2009 13:09:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: cmichae</title>
		<link>http://cmichae.acm.jhu.edu/blog/2006/12/29/state-code-mappings-for-python/#comment-2029</link>
		<dc:creator>cmichae</dc:creator>
		<pubDate>Sat, 30 Dec 2006 05:37:50 +0000</pubDate>
		<guid>http://cmichae.acm.jhu.edu/blog/2006/12/29/state-code-mappings-for-python/#comment-2029</guid>
		<description>Paddy,

Thanks for the input! A list-comprehension to get the reverse dictionary is always a good idea, provided you need both dictionaries of course.

As far as the quotes: Unfortunately, Wordpress seems to think it should help with the double quotes too! The only solution was to change them to &#38;quot;s, and I've removed the part of your comment that reposted with double quotes, as it was also changed.</description>
		<content:encoded><![CDATA[<p>Paddy,</p>
<p>Thanks for the input! A list-comprehension to get the reverse dictionary is always a good idea, provided you need both dictionaries of course.</p>
<p>As far as the quotes: Unfortunately, Wordpress seems to think it should help with the double quotes too! The only solution was to change them to &amp;quot;s, and I&#8217;ve removed the part of your comment that reposted with double quotes, as it was also changed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy</title>
		<link>http://cmichae.acm.jhu.edu/blog/2006/12/29/state-code-mappings-for-python/#comment-2024</link>
		<dc:creator>Paddy</dc:creator>
		<pubDate>Sat, 30 Dec 2006 04:42:58 +0000</pubDate>
		<guid>http://cmichae.acm.jhu.edu/blog/2006/12/29/state-code-mappings-for-python/#comment-2024</guid>
		<description>I have added a line that inverts the state_to_code dictionary to create the code_to_state dictionary from the one source so they should always track.

&lt;code&gt;&gt;&gt;&gt; code_to_state = dict((code, state) for state, code in state_to_code.iteritems())&lt;/code&gt;

P.S. something is trying to 'help out' and has changed all your single quoted strings to use matching opening and closing quote characters which is a pain for cutting and pasting your example. I used double quotes in my reply above but i wouldn't be surprised if the blogging software tried to 'help out' again!

- Paddy.</description>
		<content:encoded><![CDATA[<p>I have added a line that inverts the state_to_code dictionary to create the code_to_state dictionary from the one source so they should always track.</p>
<p><code>>>> code_to_state = dict((code, state) for state, code in state_to_code.iteritems())</code></p>
<p>P.S. something is trying to &#8216;help out&#8217; and has changed all your single quoted strings to use matching opening and closing quote characters which is a pain for cutting and pasting your example. I used double quotes in my reply above but i wouldn&#8217;t be surprised if the blogging software tried to &#8216;help out&#8217; again!</p>
<p>- Paddy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
