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
Python 3.6.0a0 (default:9f8b5053e30d+, Nov 1 2015, 18:38:37)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> trues = ['true', 'yes', 'on', '1']
>>> [bool.from_config_str(i) for i in trues]
[True, True, True, True]
>>> falses = ['false', 'no', 'off', '0', '']
>>> [bool.from_config_str(i) for i in falses]
[False, False, False, False, False]
I would be happy to try to make any additional changes necessary (including
changing ConfigParser.getboolean to use the new method) if there is interest.
Thanks!
----------
keywords: +patch
nosy: +novalis_dt
Added file: http://bugs.python.org/file40923/bool_from_config_str.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25243>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com