[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Michael Foord
Michael Foord added the comment: As in ConfigParser you are always accessing a section and value I'm happy with tuple indexing. -- ___ Python tracker ___ ___

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Ray.Allen
Ray.Allen 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 this could not

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Łukasz Langa
Łukasz Langa 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 implement a cohesive

[issue5412] extend configparser to support [] syntax

2010-07-28 Thread Éric Araujo
Éric Araujo 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 __

[issue5412] extend configparser to support [] syntax

2010-07-26 Thread Michael Foord
Michael Foord 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 ___ Python tracker

[issue5412] extend configparser to support [] syntax

2010-07-23 Thread Łukasz Langa
Łukasz Langa 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 attribute-like syntax but

[issue5412] extend configparser to support [] syntax

2010-07-09 Thread Mark Lawrence
Mark Lawrence 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 : 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"