[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I’d find more natural to have cp['spam'] return the section (as a dict) and cp['spam']['ham'] return the value. -- nosy: +merwok ___ Python tracker rep...@bugs.python.org

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: Éric, first thing: forget about the current patch because it's very much incomplete. Second thing, while I normally would agree with you about the ['section']['key'] idea, in this case the current syntax has following advantages: - we can

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: lukasz, - manipulation on the internal structures is much simpler when we have a single key like that. Having config['name'] return the section would make us create another proxy object just to support mutating keys in the section. I'm afraid

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: As in ConfigParser you are always accessing a section and value I'm happy with tuple indexing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5412

[issue5412] extend configparser to support [] syntax

2010-07-26 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: There are no docs or tests in the patch. I like the functionality though and doubt it will be controversial. The current api is a bit arcane. So +1 from me. -- nosy: +michael.foord ___

[issue5412] extend configparser to support [] syntax

2010-07-23 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: I'd say we go for it. At the moment most (if not all) drop-in replacements for ConfigParser support this functionality. It's backwards compatible and useful. One might argue than it's more pythonic than getfloat() co. I'd also add

[issue5412] extend configparser to support [] syntax

2010-07-09 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Patch is simple, are people for or against syntactic sugar in configparser? -- nosy: +BreamoreBoy stage: - unit test needed versions: +Python 3.2 -Python 3.1 ___ Python tracker

[issue5412] extend configparser to support [] syntax

2009-03-03 Thread Jeff Kaufman
New submission from Jeff Kaufman jkauf...@bbn.com: This is a patch against the configparser in the cvs version of 3.1 to support [] notation: import configparser_patched config = configparser_patched.SafeConfigParser() config.add_section(spam) config[spam, eggs] = yummy config[spam, eggs]