Embedded Python PyObject_CallObject function - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Embedded Python PyObject_CallObject function (/thread-22778.html) |
Embedded Python PyObject_CallObject function - JRHeisey - Nov-27-2019
Can anyone explain what is being returned and how I may make use of it? RE: Embedded Python PyObject_CallObject function - casevh - Nov-27-2019 A Python function always returns something. If the function returns via a bare return statement, it actually returns None. From the interactive prompt, return values of None are not shown. >>> def f(): ... return ... >>> f() >>> x=f() >>> print(x) NoneAssuming you know the function has no specific return value, there isn't much use for the new reference to None. Since you have a new reference, you must decrement the reference count before discarding it. casevh |