[issue13871] namedtuple does not normalize field names when sanitizing

2012-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: The SyntaxError is fine. The dupcheck isn't about sanitization anyway; rather, it was part of a suite of tests designed to add a more helpful error messages than the usual ones you get if you had rolled a class by hand. I would close as "invalid" but wan

[issue13871] namedtuple does not normalize field names when sanitizing

2012-01-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger priority: normal -> low ___ Python tracker ___ ___ Python

[issue13871] namedtuple does not normalize field names when sanitizing

2012-01-25 Thread Jim Jewett
New submission from Jim Jewett : collections.namedtuple raises a ValueError if any of the field names are not valid identifiers, or are duplicates. It does not normalize the identifiers when checking for duplicates. (Similar issue with the typename) >>> namedtuple("dup_fields", ["a", "a"]) Tr