Message47992
I think the basis of this patch is a good one; I think 'delimiter' should be plural as delimiters, but that might be all picky. :)
I don't think "self.delimmap = map(lambda x: x, self.delim)" should be done; map and lambda aren't needed here. Wouldn't it be cleaner to just accept a list and join it instead? More Pythonic? Since delimiter=":=" to me looks like you want the string ":=" to be a delimiter, but I might be having pascal flashbacks. To me its more clear.
E.g.:
def __init__(self, defaults=None, delimiters=(':', '=')):
self._delimiters = ''.join(delimiters)
As stated below, you don't need delimmap; "if vi in self.delim" will work fine.
Anyways, all that aside (and that's just opinions, but--):
1) The patch no longer applies cleanly to the HEAD. I believe it would be very straightforward to fix the patch up though.
2) It needs documentation, and
3) It definitely needs tests added to test_cfgparser.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:42:14 | admin | link | issue1165404 messages |
2007-08-23 15:42:14 | admin | create | |
|