[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: > Didn't know that. Well if that's the case, then obviously there is no reason > to work specifically on this conversion. If people want to use Py_NewRef(), I suggest to do while modifying the code for another reason. But not propose PRs just to use

[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-16 Thread Yonatan Goldschmidt
Yonatan Goldschmidt added the comment: > I don't see how Py_NewRef() or Py_XNewRef() is less error prone. In my > experience, any change is more likely to introduce new bugs than leaving the > code unchanged. Agree that inserting changes opens a door to introducing bugs. However, the "end

[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-09 Thread STINNER Victor
STINNER Victor added the comment: > Following https://bugs.python.org/issue42262, I think it'd be nice to convert > existing C code to use the more concise Py_NewRef() and Py_XNewRef() where > possible. Increases readability and less bug prone. In general, we don't accept changes which are

[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-07 Thread Yonatan Goldschmidt
New submission from Yonatan Goldschmidt : Following https://bugs.python.org/issue42262, I think it'd be nice to convert existing C code to use the more concise Py_NewRef() and Py_XNewRef() where possible. Increases readability and less bug prone. Opening this new issue to track the