[issue45939] PyErr_SetObject documentation lacks mention of reference counting

2021-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Ronald. If we explicitly document that PyErr_SetObject() does not steal reference we would need to document it for every parameter of every function. It would make the documentation worse because it would be more difficult to distinguish ouli

[issue45939] PyErr_SetObject documentation lacks mention of reference counting

2021-11-30 Thread Ronald Oussoren
Ronald Oussoren added the comment: The default behaviour of functions is to not steal references, in general only exceptions to this are documented. Likewise with return values: by default the result is a strong reference, and borrowed references are documented as such. -- nosy: +ron

[issue45939] PyErr_SetObject documentation lacks mention of reference counting

2021-11-30 Thread Eric Blake
New submission from Eric Blake : While PyErr_SetString is obvious that you do not have to worry about the reference count of 'exception', the documentation for PyErr_SetObject is silent on whether it steals or adds a reference to 'value'. This is particularly confusing, since other functions