cpython (merge 3.4 -> default): merge
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
http://hg.python.org/cpython/rev/f0f6650ba35e changeset: 91374:f0f6650ba35e parent: 91366:4a0a0d4d5fd5 parent: 91373:5c60dd518182 user: Raymond Hettinger <python@rcn.com> date: Tue Jun 24 15:21:24 2014 -0700 summary: merge files: Lib/collections/__init__.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -352,6 +352,7 @@ if isinstance(field_names, str): field_names = field_names.replace(',', ' ').split() field_names = list(map(str, field_names)) + typename = str(typename) if rename: seen = set() for index, name in enumerate(field_names): @@ -362,6 +363,8 @@ field_names[index] = '_%d' % index seen.add(name) for name in [typename] + field_names: + if type(name) != str: + raise TypeError('Type names and field names must be strings') if not name.isidentifier(): raise ValueError('Type names and field names must be valid ' 'identifiers: %r' % name) -- Repository URL: http://hg.python.org/cpython
participants (1)
-
raymond.hettinger