[Python-checkins] r79962 - python/trunk/Lib/collections.py

raymond.hettinger python-checkins at python.org
Sun Apr 11 22:39:28 CEST 2010


Author: raymond.hettinger
Date: Sun Apr 11 22:39:28 2010
New Revision: 79962

Log:
Minor factoring

Modified:
   python/trunk/Lib/collections.py

Modified: python/trunk/Lib/collections.py
==============================================================================
--- python/trunk/Lib/collections.py	(original)
+++ python/trunk/Lib/collections.py	Sun Apr 11 22:39:28 2010
@@ -452,12 +452,11 @@
 
         '''
         if iterable is not None:
+            self_get = self.get
             if isinstance(iterable, Mapping):
-                self_get = self.get
                 for elem, count in iterable.items():
                     self[elem] = self_get(elem, 0) - count
             else:
-                self_get = self.get
                 for elem in iterable:
                     self[elem] = self_get(elem, 0) - 1
         if kwds:


More information about the Python-checkins mailing list