On 26.08.2012, 18:15:55 Phil Thompson wrote:
> On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote:
>> On 15.08.2012, 11:05:42 Phil Thompson wrote:
>>> I could change sipTransferTo() to do this if the owner was Py_None. At
>>> the
>>> moment this is undocumented behaviour. Would this be sufficient?
>> 
>> I believe so.

> Done in hg.

Phil,

First tests show that this works well. It's an important feature, but
burried deeply in the documentation, well, actually sort of obscured.

Function "sipConvertToType" is documented as:

If transferObj is NULL then the ownership is unchanged. If it is Py_None then
ownership is transferred to Python via a call to sipTransferBack().
Otherwise ownership is transferred to C/C++ and obj associated with
transferObj via a call to sipTransferTo().

Function "sipTransferTo" tells us:
... If owner is Py_None then obj is given an extra reference which is
removed when the C++ instance’s destructor is called. ...


Since "sipTransferTo" is mentioned by the docs of "sipConvertToType", who
would guess that Py_None has such a different meaning?

How about adding a corresponding hint to the documentation
of "sipConvertToType"?

Best Regards,
Mathias Born

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to