On Wed, Apr 27, 2016 at 11:06 AM, Serhiy Storchaka wrote:
> I think it is better to have relation with PyModule_AddIntConstant() etc
> than with PyObject_SetAttrString.
>
> My patch doesn't introduce new public function, but changes the behavior of
> the old function. This needs minimal changes to
Hrvoje Niksic avl.com> writes:
> This inconsistency has caused bugs (or, more fairly, potential leaks)
> before, see http://bugs.python.org/issue1782
>
> Unfortunately, the suggested Python 3 change to PyModule_AddObject was
> not accepted.
First, these "leaks" only potentially show up when yo
On 27.04.16 16:08, Nick Coghlan wrote:
On 27 April 2016 at 17:14, Serhiy Storchaka wrote:
I think that we can resolve this issue by following steps:
1. Add a new function PyModule_AddObject2(), that steals a reference even on
failure.
I'd suggest a variant on this that more closely matches t
On 27.04.16 15:31, Hrvoje Niksic wrote:
On 04/27/2016 09:14 AM, Serhiy Storchaka wrote:
There are three functions (or at least three documented functions) in C
API that "steals" references: PyList_SetItem(), PyTuple_SetItem() and
PyModule_AddObject(). The first two "steals" references even on fa
On 27.04.16 10:14, Serhiy Storchaka wrote:
There are three functions (or at least three documented functions) in C
API that "steals" references: PyList_SetItem(), PyTuple_SetItem() and
PyModule_AddObject(). The first two "steals" references even on failure,
and this is well known behaviour. But P
On 27 April 2016 at 23:08, Nick Coghlan wrote:
> On 27 April 2016 at 17:14, Serhiy Storchaka wrote:
>> I think that we can resolve this issue by following steps:
>>
>> 1. Add a new function PyModule_AddObject2(), that steals a reference even on
>> failure.
>
> I'd suggest a variant on this that m
On 27 April 2016 at 17:14, Serhiy Storchaka wrote:
> I think that we can resolve this issue by following steps:
>
> 1. Add a new function PyModule_AddObject2(), that steals a reference even on
> failure.
I'd suggest a variant on this that more closely matches the
PyList_SetItem and PyTuple_SetIte
On 04/27/2016 09:14 AM, Serhiy Storchaka wrote:
There are three functions (or at least three documented functions) in C
API that "steals" references: PyList_SetItem(), PyTuple_SetItem() and
PyModule_AddObject(). The first two "steals" references even on failure,
and this is well known behaviour.
On Wed, Apr 27, 2016 at 10:14 AM, Serhiy Storchaka wrote:
> I think that we can resolve this issue by following steps:
>
> 1. Add a new function PyModule_AddObject2(), that steals a reference even on
> failure.
+1
It would be good to document PyModule_AddObject's current behavior in
3.5+ (alread
There are three functions (or at least three documented functions) in C
API that "steals" references: PyList_SetItem(), PyTuple_SetItem() and
PyModule_AddObject(). The first two "steals" references even on failure,
and this is well known behaviour. But PyModule_AddObject() "steals" a
reference
10 matches
Mail list logo