[Python-checkins] r87028 - python/branches/py3k/Lib/configparser.py
lukasz.langa
python-checkins at python.org
Sat Dec 4 12:48:12 CET 2010
Author: lukasz.langa
Date: Sat Dec 4 12:48:11 2010
New Revision: 87028
Log:
configparser: minute refactoring of RawConfigParser.items()
Modified:
python/branches/py3k/Lib/configparser.py
Modified: python/branches/py3k/Lib/configparser.py
==============================================================================
--- python/branches/py3k/Lib/configparser.py (original)
+++ python/branches/py3k/Lib/configparser.py Sat Dec 4 12:48:11 2010
@@ -848,15 +848,11 @@
if vars:
for key, value in vars.items():
d[self.optionxform(key)] = value
- options = list(d.keys())
+ value_getter = lambda option: self._interpolation.before_get(self,
+ section, option, d[option], d)
if raw:
- return [(option, d[option])
- for option in options]
- else:
- return [(option, self._interpolation.before_get(self, section,
- option, d[option],
- d))
- for option in options]
+ value_getter = lambda option: d[option]
+ return [(option, value_getter(option)) for option in d.keys()]
def optionxform(self, optionstr):
return optionstr.lower()
More information about the Python-checkins
mailing list