[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-27 Thread STINNER Victor
STINNER Victor added the comment: For all reasons alread given in the previous comment and my comment below, I reject the proposed change. Serhiy> See also issue26748. Classes usually have True boolean value, but empty enum classes were False-y by accident. This was considered a bug.

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue26748. Classes usually have True boolean value, but empty enum classes were False-y by accident. This was considered a bug. -- ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The change can break existing code that uses boolean testing > instead of checking for None. For this reason, I think Guido would oppose this proposal. In the past he has objected to iterators having a True boolean value to indicate that there were

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure that it is worth to implement the __bool__() method. This doesn't add much in comparison with checking the returncode attribute. The change can break existing code that uses boolean testing instead of checking for None. --

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-26 Thread Sayan Chowdhury
Changes by Sayan Chowdhury : -- pull_requests: +273 ___ Python tracker ___ ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-18 Thread Sayan Chowdhury
Sayan Chowdhury added the comment: I am taking over to do the rest part required for this ticket. -- nosy: +sayanchowdhury ___ Python tracker ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Thank you for the hint. I never before contributed code to the python foundation and thus am not familiar with the process. I will look into it when I find the time. -- ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not enough. New feature should be documented (in new method docstring, in subprocess documentation and in What's New document) and tested. And please sign a Contributor Licensing Agreement. http://www.python.org/psf/contrib/contrib-form/

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Please excuse my ambiguous phrasing. What I meant was I created the patch _from_ the Python 3.5.1 module _for_ Python 3.6. -- ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread STINNER Victor
STINNER Victor added the comment: It's a new feature, it should only go to Python 3.6. -- ___ Python tracker ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: I took the liberty to create a patch for Python v3.5.1. -- keywords: +patch nosy: +Richard Neumann Added file: http://bugs.python.org/file42828/subprocess.patch ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-04-26 Thread Berker Peksag
Berker Peksag added the comment: The idea sounds good to me. -- nosy: +berker.peksag stage: -> needs patch versions: +Python 3.6 -Python 3.5 ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-22 Thread STINNER Victor
STINNER Victor added the comment: Can you please give examples of use cases? (code) -- nosy: +haypo ___ Python tracker ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-22 Thread Richard Neumann
Richard Neumann added the comment: A useless use case is attached. Basically it boils down to having the ability to evaluate the CompletedProcess directly by if/else rather than comparing its returncode attribute to zero each time or handling the exception raised by check_returncode(). I use

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-21 Thread Richard Neumann
New submission from Richard Neumann: The class subprocess.CompletedProcess is currently lacking a __bool__() method. It might be a practical feature to have the possibility to evaluate a CompletedProcess instance in an if/else block without the necessity to handle the exception raised by