title: Strange behaviour while replacing string in python
body: <p>I have a date given in format "October 28, 2010" (or simillar). Now I want to change the full name of month to shorter version (in this case Oct). For this I prepared a dictionary:</p>
  
  <pre><code>_mapping = {'January': 'Jan', 
              'February': 'Feb', 
              'March': 'Mar', 
              'April': 'Apr', 
              'May': 'May', 
              'June': 'Jun', 
              'July': 'Jul', 
              'August': 'Aug', 
              'September': 'Sep', 
              'October': 'Oct', 
              'November': 'Nov', 
              'December': 'Dec'}
  </code></pre>
  
  <p>and in the method where the substition goes I wrote following:</p>
  
  <pre><code>def fetch(self, pno):
      ...
      date = #get data (working fine)
      for l, s in self._mapping.iteritems():
          pubdate = date.replace(l, s)
          print l + " -&gt; " + pubdate #this is only for debug
      (pubd_month, self.pubd_day, self.pubd_year) = pubdate.split(' ')
      print pubd_month, self.pubd_day, self.pubd_year
      print pubdate
  </code></pre>
  
  <p>The result of execution is:</p>
  
  <pre><code>February -&gt; October 28, 2008
  October -&gt; Oct 28, 2008
  January -&gt; October 28, 2008
  April -&gt; October 28, 2008
  November -&gt; October 28, 2008
  March -&gt; October 28, 2008
  August -&gt; October 28, 2008
  May -&gt; October 28, 2008
  December -&gt; October 28, 2008
  June -&gt; October 28, 2008
  September -&gt; October 28, 2008
  July -&gt; October 28, 2008
  October
  October 28, 2008
  </code></pre>
  
  <p>As you can see it seems that the replacement goes ok when it finds October but outside the loop I get again full month name. What do I do wrong? </p>
  
  <p>Another question: is there shorter way to do this?</p>