[issue24037] Argument Clinic: add the boolint converter

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 202fda55c2dffe27125703225e5af92254602dc6 by Serhiy Storchaka in branch 'master': bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485) https://github.com/python/cpython/commit/202fda55c2dffe27125703225e5af92254602dc6

[issue24037] Argument Clinic: add the boolint converter

2017-03-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24037] Argument Clinic: add the boolint converter

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: -601 ___ Python tracker ___ ___

[issue24037] Argument Clinic: add the boolint converter

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: +601 ___ Python tracker ___ ___

[issue24037] Argument Clinic: add the boolint converter

2017-03-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +398 ___ Python tracker ___ ___

[issue24037] Argument Clinic: add the boolint converter

2017-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch uses bool(accept={int}) rather of boolint. It also updates more functions converted to Argument Clinic. -- versions: +Python 3.7 -Python 3.5 Added file: http://bugs.python.org/file46700/clinic-boolint-converter-3.patch

[issue24037] Argument Clinic: add the boolint converter

2015-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated to the tip. Used new converter in recently converted _tkinter and _codecs modules. Now it is used 30 times. -- Added file: http://bugs.python.org/file39349/clinic_boolint_converter_2.patch ___ Python

[issue24037] Argument Clinic: add the boolint converter

2015-04-27 Thread Tal Einat
Tal Einat added the comment: If I was writing a function/method with a conceptually boolean parameter (True/False), I wouldn't want that to accept any Python object. For example, I would want passing a tuple or list to raise a TypeError. But according to the docs[1], that's what the 'p'

[issue24037] Argument Clinic: add the boolint converter

2015-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I proposed boolint or intbool. Are there better variants? An alternative is add accept={int} parameter to the bool converter. But this will complicate the implementation and the use without the need. -- ___

[issue24037] Argument Clinic: add the boolint converter

2015-04-25 Thread Tal Einat
Tal Einat added the comment: If this was for internal use only, intended to ease the transition to Argument Clinic, then extensibility isn't an issue. An upside to this is that it would make it easy in the future to find all of the places in the stdlib using integers instead of bools. A

[issue24037] Argument Clinic: add the boolint converter

2015-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I consider this as transitional style, for simpler converting to Argument Clinic without changing the behaviour. In future it can be replaced with bool. But the bool converter has a downside. It is harder to extend it. We can't add a support of say a tuple,

[issue24037] Argument Clinic: add the boolint converter

2015-04-23 Thread Larry Hastings
Larry Hastings added the comment: I think this is silly. Python has a well-understood concept of truth: https://docs.python.org/3/library/stdtypes.html#truth-value-testing I assert that the reason people used the i format unit for what are really boolean values is because a) the p format

[issue24037] Argument Clinic: add the boolint converter

2015-04-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The 'i' format unit is often used for semantically boolean values. When the parameter has a default value, in Argument clinic you should specify it twice, as Python and C values: closefd: int(c_default=1) = True or keepends: