[Python-checkins] cpython: Minor clean-ups.
raymond.hettinger
python-checkins at python.org
Wed Mar 23 22:38:48 CET 2011
http://hg.python.org/cpython/rev/59127dcefd87
changeset: 68882:59127dcefd87
user: Raymond Hettinger <python at rcn.com>
date: Wed Mar 23 14:38:39 2011 -0700
summary:
Minor clean-ups.
files:
Lib/collections/__init__.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -321,7 +321,9 @@
for index, name in enumerate(field_names):
if (not all(c.isalnum() or c=='_' for c in name)
or _iskeyword(name)
- or not name or name[0].isdigit() or name.startswith('_')
+ or not name
+ or name[0].isdigit()
+ or name.startswith('_')
or name in seen):
field_names[index] = '_%d' % index
seen.add(name)
@@ -351,8 +353,7 @@
for index, name in enumerate(field_names))
)
- # Execute the class definition string in a temporary namespace and
- # support tracing utilities by setting a value for frame.f_globals['__name__']
+ # Execute the class definition string in a temporary namespace
namespace = {}
try:
exec(class_definition, namespace)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list