[issue30248] Using boolean arguments in the _json module

2017-05-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30248] Using boolean arguments in the _json module

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1 by Serhiy Storchaka in branch 'master': bpo-30248: Convert boolean arguments only once in _json. (#1423) https://github.com/python/cpython/commit/ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1 --

[issue30248] Using boolean arguments in the _json module

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks like a nice improvement. -- ___ Python tracker ___ ___

[issue30248] Using boolean arguments in the _json module

2017-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Initially I was going to add explicit bool() calls in Python implementations, so that Python and C implementation behave the same in case of non-constant options. But then I figured out that is behavior is insane and we shouldn't guarantee anything in this

[issue30248] Using boolean arguments in the _json module

2017-05-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: So, incredibly minor note: This will prevent a ridiculous use case of passing in a mutable object as the argument (say, a list), and mutating it between truthy and falsy values (appending or clearing) to toggle behaviors in an existing Encoder. Note: As

[issue30248] Using boolean arguments in the _json module

2017-05-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Core dump when use uninitialized _json objects ___ Python tracker ___

[issue30248] Using boolean arguments in the _json module

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

[issue30248] Using boolean arguments in the _json module

2017-05-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently PyObject_IsTrue() is called every time when bool attributes (_json.Scanner.strict, _json.Encoder.sort_keys, _json.Encoder.skipkeys) are used in C acceleration of the json module. PyObject_IsTrue() is fast when the argument is a bool, but in any