Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Joseph Bane
On 8/9/16 1:42 PM, Terry Reedy wrote: > On 8/9/2016 9:22 AM, Joseph Bane wrote: >> Hello. >> >> It recently came to my attention that the strtobool function in the >> standard library doesn't return Python native boolean values, but >> rather returns integer 0 or 1: >> >>

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Terry Reedy
On 8/9/2016 9:22 AM, Joseph Bane wrote: Hello. It recently came to my attention that the strtobool function in the standard library doesn't return Python native boolean values, but rather returns integer 0 or 1: https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#l304 I am curious

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 9:50 AM Joseph Bane wrote: > Thank you for your note. I was thinking it might be just a historical > artifact. > That was just my guess. You can search the mailing list archives and the bug tracker to find out if there's been any past discussion.

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Joseph Bane
Thank you for your note. I was thinking it might be just a historical artifact. Do you think this is the type of thing we could propose be changed in the next version of Python? It seems it would be more consistent with the principle of least surprise from the perspective of outsider Python

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Lutz Horn
Am 08/09/2016 um 03:22 PM schrieb Joseph Bane: It recently came to my attention that the strtobool function in the standard library doesn't return Python native boolean values, but rather returns integer 0 or 1: In boolean context, 1 is True and 0 is False. So you should be able to use the

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Joseph Bane
On Tuesday, August 9, 2016 at 9:34:44 AM UTC-4, Michael Selik wrote: > On Tue, Aug 9, 2016 at 9:26 AM Joseph Bane wrote: > > > Hello. > > > > It recently came to my attention that the strtobool function in the > > standard library doesn't return Python native boolean values, but rather > >

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 9:26 AM Joseph Bane wrote: > Hello. > > It recently came to my attention that the strtobool function in the > standard library doesn't return Python native boolean values, but rather > returns integer 0 or 1: > >

Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Joseph Bane
Hello. It recently came to my attention that the strtobool function in the standard library doesn't return Python native boolean values, but rather returns integer 0 or 1: https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#l304 I am curious why this is the defined behavior and