msg170897 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-09-21 15:47 |
Issue14705 added 'bool' format character to PyArg_ParseTuple for using it for parsing multiple boolean arguments in os module. The proposed patch uses this format character for other boolean arguments. This makes the sources simpler, clearer and more reliable, improves error messages, gets rid of a few rare errors. |
|
|
msg170898 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2012-09-21 15:59 |
Patch looks fine in principle, though I'd want someone to go over the individual cases to make sure they make sense. Also, I have something up my sleeve regarding argument parsing for 3.4, and if it gets accepted we might be touching all this code anyway. I mention this just to say--you may want to hold off on more patches like this for now. |
|
|
msg252765 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2015-10-11 05:38 |
Has this been entirely superseded by Argument Clinic? |
|
|
msg253154 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2015-10-18 16:22 |
No, it is orthogonal to Argument Clinic. Usually converting to Argument Clinic didn't change semantic. However these changes conflicted with proposed patch. Rebased patch is splitted on two patches. bool_cleanup.patch. It almost doesn't change the behavior. It uses the "p" format unit instead of manually called PyObject_IsTrue(), passes boolean value instead 0/1 integers to functions that needs boolean, and made some arguments ("flush" in print(), "strict", "sort_keys" and "skipkeys" in json module) to be converted to boolean only once. accept_bool.patch. It makes a number of functions to accept arbitrary objects in boolean context, not just False/True and ints representable as C int. But I prefer first to commit the patch for . |
|
|
msg350940 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2019-09-01 09:11 |
New changeset eb8974616bc58f44b2a3c3e4ca2326894ae42c8f by Serhiy Storchaka in branch 'master': bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622) https://github.com/python/cpython/commit/eb8974616bc58f44b2a3c3e4ca2326894ae42c8f |
|
|
msg350941 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2019-09-01 09:12 |
New changeset 5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe by Serhiy Storchaka in branch 'master': bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621) https://github.com/python/cpython/commit/5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe |
|
|
msg350942 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2019-09-01 09:16 |
New changeset 1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 by Serhiy Storchaka in branch 'master': bpo-15999: Clean up of handling boolean arguments. (GH-15610) https://github.com/python/cpython/commit/1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 |
|
|