[issue29878] Add global instances of int 0 and 1

2017-04-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bae6881b4215b2613ad08ef0dc7bed7743c2b8cc by Serhiy Storchaka in branch 'master': Update Argument Clinic generated code for bpo-29878. (#1001) https://github.com/python/cpython/commit/bae6881b4215b2613ad08ef0dc7bed7743c2b8cc -- ___

[issue29878] Add global instances of int 0 and 1

2017-04-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1174 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue29878] Add global instances of int 0 and 1

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

[issue29878] Add global instances of int 0 and 1

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb by Serhiy Storchaka in branch 'master': bpo-29878: Add global instances of int for 0 and 1. (#852) https://github.com/python/cpython/commit/ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb -- _

[issue29878] Add global instances of int 0 and 1

2017-03-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +752 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29878] Add global instances of int 0 and 1

2017-03-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one idea that can make the code simpler is make PyLong_FromLong(0) and PyLong_FromLong(1) never failing. I.e. require NSMALLPOSINTS not less than 2. > Also consider adding new function PyLong_Increment. This basic operation is > small pain using the cur

[issue29878] Add global instances of int 0 and 1

2017-03-22 Thread STINNER Victor
STINNER Victor added the comment: Other common values used in C functions: empty byte string, empty Unicode string, empty tuple. The problem is to make sure that singletons are created in the right order :-/ This issue reminded me an old idea of writing a generalization of the _Py_IDENTIFIER(

[issue29878] Add global instances of int 0 and 1

2017-03-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for this idea. Also consider adding new function PyLong_Increment. This basic operation is small pain using the current API. It may also give a small speed benefit. -- nosy: +rhettinger ___ Python tracker

[issue29878] Add global instances of int 0 and 1

2017-03-22 Thread STINNER Victor
STINNER Victor added the comment: +1. Please create a PR for it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue29878] Add global instances of int 0 and 1

2017-03-22 Thread Mark Dickinson
Mark Dickinson added the comment: I like it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue29878] Add global instances of int 0 and 1

2017-03-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: When C code needs to compare Python object with int 0 or add int 1 it either use local reference to PyLong_FromLong(0) and PyLong_FromLong(1) which should be decrefed just after use or module level global variable initialized and cleared during initializin