|
From: Fuzzyman <fuz...@vo...> - 2006-01-30 14:45:44
|
Nicola Larosa wrote: > [snip..] >> * To make it a method on ConfigObj (*not* sections) and allow section to >> be a string *or* a reference to a subsection - in which case the >> specified key would be taken from that. >> > > How would you specify nested sections in a string? Dotted notation? Section > names are not restricted to Python identifier syntax, right? Anyway, having > methods on section objects seems more versatile. > > It sounds like a section method with ``None`` for the section (if not referencing a key in a sub-section) is the way. (Consider it decided unless someone shouts.) *However*, what I meant here is that you pass in a string to specify a section one level down. To specify a nested section you pass in a *reference* to the section - not a string at all. I don't come from a static language background, so I'm agnostic about arguments that can be of more than one type. In some circles I believe this is frowned upon as bad practise... > >> Should I then remove ``istrue`` (added in 4.1.0) which is effectively >> the same as ``getboolean`` ? I would deprecate it and add a warning >> until 4.3.0. >> > > Yes, better avoid multiple ways of doing the same thing, especially if it's > a recent thing. > > Cool - I added it in 4.1.0, but ``getboolean`` is better anyway. Thanks |