summaryrefslogtreecommitdiffstats
path: root/Lib/collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-05-21 16:40:10 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-05-21 16:40:10 (GMT)
commit767debb6aa5729e919da309ecc770f8b2d94beba (patch)
tree668f74f7f1ce5f7fc23b9d8fbefc7420c35f1753 /Lib/collections.py
parent0d6a8ccfb7b602c97fd3dd2a57eaa8138c811186 (diff)
downloadcpython-767debb6aa5729e919da309ecc770f8b2d94beba.zip
cpython-767debb6aa5729e919da309ecc770f8b2d94beba.tar.gz
cpython-767debb6aa5729e919da309ecc770f8b2d94beba.tar.bz2
Allow all alphanumeric and underscores in type and field names.
Diffstat (limited to 'Lib/collections.py')
-rw-r--r--Lib/collections.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index a2ce552..4a860dd 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -24,7 +24,7 @@ def NamedTuple(typename, s):
"""
field_names = s.split()
- if not ''.join([typename] + field_names).replace('_', '').isalpha():
+ if not ''.join([typename] + field_names).replace('_', '').isalnum():
raise ValueError('Type names and field names can only contain alphanumeric characters and underscores')
argtxt = ', '.join(field_names)
reprtxt = ', '.join('%s=%%r' % name for name in field_names)