mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Fix namedtuple bug reported by Glenn Linderman. Template did not form correctly if the field names were input in Unicode.
This commit is contained in:
parent
17617a07d1
commit
6ee7bc04f7
2 changed files with 6 additions and 1 deletions
|
@ -34,6 +34,11 @@ class TestNamedTuple(unittest.TestCase):
|
|||
namedtuple('Point0', 'x1 y2') # Verify that numbers are allowed in names
|
||||
namedtuple('_', 'a b c') # Test leading underscores in a typename
|
||||
|
||||
nt = namedtuple('nt', u'the quick brown fox') # check unicode input
|
||||
self.assert_("u'" not in repr(nt._fields))
|
||||
nt = namedtuple('nt', (u'the', u'quick')) # check unicode input
|
||||
self.assert_("u'" not in repr(nt._fields))
|
||||
|
||||
self.assertRaises(TypeError, Point._make, [11]) # catch too few args
|
||||
self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue