[issue27721] strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane

New submission from Joseph Bane:

The distutils strtobool function returns 0 or 1 rather than the native boolean 
type True or False values:

https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#l304

Please see the attached patch for updates to this function. I have included 
updates to use a f-string in the raise and casefold instead of lower.

--
components: Distutils
files: patch.diff
keywords: patch
messages: 272263
nosy: Joseph Bane, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: strtobool returns 0 and 1 rather than False and True
type: enhancement
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file44060/patch.diff

___
Python tracker 
<http://bugs.python.org/issue27721>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane

Joseph Bane added the comment:

Thank you for the feedback. Please find an updated patch attached.

--
Added file: http://bugs.python.org/file44061/patch.diff

___
Python tracker 
<http://bugs.python.org/issue27721>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-10 Thread Joseph Bane

Joseph Bane added the comment:

Thank you for your feedback. I definitely understand your reasoning and 
commitment to not introducing breaking changes in externally facing codes. I 
also agree that this does fall slightly more on the side of aesthetic rather 
than functional changes. However, this change doesn't seem like it is 
significantly altering the interface of strtobool; if anything it is making it 
clearer and less surprising, especially for Python 2/3+ users.

I know, as someone in that category, having learned Python at version 2.5, that 
it was a bit surprising when I got back an integer from this function rather 
than the native True and False values. I also want to emphasize that this 
change is specifically targeting Python 3.6, not 2.7, 3.4, or 3.5. Making this 
small change in a not-yet-released version should be safe, but, of course, that 
is my outsider opinion. You absolutely have a valid point if I were asking that 
we change a released version and it is not something I take lightly.

Lastly, this is the kind of change I would hope I could make easily as a first 
time contributor to the project because of it being more of an aesthetic one. 
After all, isn't the whole point of making changes to a project about making it 
cleaner, modern, and clearer?

Thanks again. I really appreciate the feedback and discussion. P.S. If there is 
support to introduce this change, I will certainly update the tests and docs as 
pointed out.

--

___
Python tracker 
<http://bugs.python.org/issue27721>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com