Author lukasz.langa
Recipients fdrake, georg.brandl, lukasz.langa, michael.foord, pitrou
Date 2010-09-03.22:43:47
SpamBayes Score 1.01804e-05
Marked as misclassified No
Message-id <1283553829.6.0.323688956026.issue9421@psf.upfronthosting.co.za>
In-reply-to
Content
On IRC Fred asked:
> Why are delimiters and comment_prefixes in the constructor signatures?

Like most configurable options, they were added to the initializer one by one (after `allow_no_value`). Only later did I notice that actually things like optionxform, _boolean_states, etc. are configurable by assignment. So this is a design decision whether one way should be preferred over the other. In a way that's unfortunate that we now have two obvious ways to do it.

I believe that keyword arguments are far better because they are more declarative, e.g.:

parser = SafeConfigParser(delimiters=(':=',),
                          comment_prefixes=('//',))

vs.

parser = SafeConfigParser()
parser._delimiters = (':=',)
parser._comment_prefixes = ('//',)

It's the way ORMs and many other frameworks do it and it feels natural.
History
Date User Action Args
2010-09-03 22:43:49lukasz.langasetrecipients: + lukasz.langa, fdrake, georg.brandl, pitrou, michael.foord
2010-09-03 22:43:49lukasz.langasetmessageid: <1283553829.6.0.323688956026.issue9421@psf.upfronthosting.co.za>
2010-09-03 22:43:48lukasz.langalinkissue9421 messages
2010-09-03 22:43:47lukasz.langacreate