<?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: How to get a Month Name in Python</title>
	<atom:link href="http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/</link>
	<description>Answers to everything I search for, every day</description>
	<lastBuildDate>Wed, 25 Aug 2010 09:41:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeremy Banks</title>
		<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/comment-page-1/#comment-61097</link>
		<dc:creator>Jeremy Banks</dc:creator>
		<pubDate>Fri, 17 Apr 2009 18:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/#comment-61097</guid>
		<description>@Rob

I&#039;m not confident, but I don&#039;t see why not. It&#039;s a public data attribute of the module, so it would be available, and &lt;code&gt;.__getitem__&lt;/code&gt; should still work on it regardless of if it&#039;s implemented in C or Python (it works for builtins written in C, such as lists).

I don&#039;t think it&#039;s a good approach, since using special methods directly should be avoided if possible, but as far as I know it should work.</description>
		<content:encoded><![CDATA[<p>@Rob</p>
<p>I&#8217;m not confident, but I don&#8217;t see why not. It&#8217;s a public data attribute of the module, so it would be available, and <code>.__getitem__</code> should still work on it regardless of if it&#8217;s implemented in C or Python (it works for builtins written in C, such as lists).</p>
<p>I don&#8217;t think it&#8217;s a good approach, since using special methods directly should be avoided if possible, but as far as I know it should work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/comment-page-1/#comment-61096</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Fri, 17 Apr 2009 16:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/#comment-61096</guid>
		<description>@Jeremy

Are you sure that would work if the calendar module were reimplemented in C?</description>
		<content:encoded><![CDATA[<p>@Jeremy</p>
<p>Are you sure that would work if the calendar module were reimplemented in C?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rgz</title>
		<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/comment-page-1/#comment-61088</link>
		<dc:creator>rgz</dc:creator>
		<pubDate>Fri, 17 Apr 2009 04:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/#comment-61088</guid>
		<description>If you don&#039;t mind that it isn&#039;t a function why not?
    from calendar import month_name
But since calendar is in the stdlib I encourage you to use calendar.month_name[] every time except in CPU bound loops.</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t mind that it isn&#8217;t a function why not?<br />
    from calendar import month_name<br />
But since calendar is in the stdlib I encourage you to use calendar.month_name[] every time except in CPU bound loops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Banks</title>
		<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/comment-page-1/#comment-61087</link>
		<dc:creator>Jeremy Banks</dc:creator>
		<pubDate>Fri, 17 Apr 2009 04:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/#comment-61087</guid>
		<description>This didn&#039;t occur to me as instantly, but if we were golfing a usable function, it would probably be shortest to do:

&lt;code&gt;named_month = calendar.month_name.__getitem__&lt;/code&gt;

... which works the same (slightly more efficient, actually) and knocks off a further 16 characters. It is probably less readable, though. Actually, those 16 characters is the same amount we&#039;d save if we used a single-character identifier for the index (which we obviously don&#039;t want to do for readability reasons, so it&#039;s probably not really a noteworthy saving at all.</description>
		<content:encoded><![CDATA[<p>This didn&#8217;t occur to me as instantly, but if we were golfing a usable function, it would probably be shortest to do:</p>
<p><code>named_month = calendar.month_name.__getitem__</code></p>
<p>&#8230; which works the same (slightly more efficient, actually) and knocks off a further 16 characters. It is probably less readable, though. Actually, those 16 characters is the same amount we&#8217;d save if we used a single-character identifier for the index (which we obviously don&#8217;t want to do for readability reasons, so it&#8217;s probably not really a noteworthy saving at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Banks</title>
		<link>http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/comment-page-1/#comment-61086</link>
		<dc:creator>Jeremy Banks</dc:creator>
		<pubDate>Fri, 17 Apr 2009 04:02:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.answermysearches.com/how-to-get-a-month-name-in-python/421/#comment-61086</guid>
		<description>Here&#039;s a 12-character-shorter version that I feel is nicer.

&lt;code&gt;named_month = lambda month_num:calendar.month_name[month_num]&lt;/code&gt;

Obviously requiring &lt;code&gt;import calendar&lt;/code&gt; beforehand, as yours requires &lt;code&gt;import datetime&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a 12-character-shorter version that I feel is nicer.</p>
<p><code>named_month = lambda month_num:calendar.month_name[month_num]</code></p>
<p>Obviously requiring <code>import calendar</code> beforehand, as yours requires <code>import datetime</code>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
