Message81464
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'] |
|
Date |
User |
Action |
Args |
2009-02-09 16:54:03 | rhettinger | set | recipients:
+ rhettinger, skip.montanaro, barry, jdwhitley |
2009-02-09 16:54:03 | rhettinger | set | messageid: <1234198443.01.0.569356296204.issue1818@psf.upfronthosting.co.za> |
2009-02-09 16:54:00 | rhettinger | link | issue1818 messages |
2009-02-09 16:53:59 | rhettinger | create | |
|