Author rhettinger
Recipients barry, jdwhitley, rhettinger, skip.montanaro
Date 2009-02-09.16:53:59
SpamBayes Score 2.41378e-09
Marked as misclassified No
Message-id <1234198443.01.0.569356296204.issue1818@psf.upfronthosting.co.za>
In-reply-to
Content
Consider providing a hook to a function that converts non-conforming
field names (ones with a leading underscore, leading digit, non-letter,
keyword, or duplicate name).

class NamedTupleReader:
    def __init__(self, f, fieldnames=None, restkey=None, restval=None,
                 dialect="excel", fieldnamer=None, *args, **kwds):
                 . . .

I'm going to either post a recipe to do the renaming or provide a static
method for the same purpose.   It might work like this:

  >>> renamer(['abc', 'def', '1', '_hidden', 'abc', 'p', 'abc'])
  ['abc', 'x_def', 'x_1', 'x_hidden', 'x_abc', 'p', 'x1_abc']
History
Date User Action Args
2009-02-09 16:54:03rhettingersetrecipients: + rhettinger, skip.montanaro, barry, jdwhitley
2009-02-09 16:54:03rhettingersetmessageid: <1234198443.01.0.569356296204.issue1818@psf.upfronthosting.co.za>
2009-02-09 16:54:00rhettingerlinkissue1818 messages
2009-02-09 16:53:59rhettingercreate