[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Though come to think of it, the issue you raised with using "from" in the method name wouldn't apply here, since the static method is on the bool class, and the method does return bool. -- ___ Python tracker

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Actually, looks like the version of the patch I attached did use the name `bool.from_config_str`, sorry about that -- I'll attach a new patch renaming this to `bool.parse_config_str` if there is interest in further consideration. --

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-27 Thread Joshua Bronson
Joshua Bronson added the comment: Hi Raymond, I'm a bit confused by your comment. The patch I attached to my previous message adds the static method `bool.parse_config_str`. So there's no need to `import configparser` to use this, and "from" is no longer included in the proposed method name.

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-26 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker ___

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm not sure I see the point in moving this out to a separate method (i.e. I wouldn't want to see people importing configparser just to use this particular group of boolean word aliases). In general, users would be better served by a simple dictionary

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2015-11-01 Thread Joshua Bronson
Joshua Bronson added the comment: My friend @novalis_dt and I worked up a patch for this including tests (attached). First time working with the CPython codebase but hope it's a reasonable start. Here's a preview: ~> ./python.exe

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2015-09-27 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +lukasz.langa ___ Python tracker ___ ___

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2015-09-26 Thread Joshua Bronson
New submission from Joshua Bronson: ConfigParser.getboolean[1] has logic to convert strings like '0' and 'False' to False. This logic is generally useful in other contexts and need not be coupled to ConfigParser. Would you consider accepting a patch that factored this string-to-boolean logic

[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2015-09-26 Thread Joshua Bronson
Joshua Bronson added the comment: One way this could be offered is as a new static method on bool (something like bool.parse_str?), but I of course defer to the better judgment of the Python core developers. I'd be happy to take a crack at a patch adding it wherever you like, if you like.