picop.cyfunction#
Function-object helpers.
- picop.cyfunction.func_check(o)#
Return True if
ois a Python function object (PyFunction_Check). :type o:object:param o:- Return type:
- picop.cyfunction.func_eq(a, b)#
Return True if
a is b(function-object identity; CPythonobject.__eq__). :type a:object:param a: :type b:object:param b:- Return type:
- picop.cyfunction.func_get_closure(op)#
Return closure cell tuple of
op, orNone. :type op:object:param op:
- picop.cyfunction.func_get_code(op)#
Return the code object of function
op(owned ref). :type op:object:param op:- Return type:
- picop.cyfunction.func_get_defaults(op)#
Return argument defaults tuple of
op, orNone. :type op:object:param op:
- picop.cyfunction.func_get_globals(op)#
Return the globals dict of function
op(owned ref). :type op:object:param op:- Return type:
- picop.cyfunction.func_get_module(op)#
Return
op.__module__(owned ref), orNoneif unset. :type op:object:param op:
- picop.cyfunction.func_new(code, globals)#
Return a new function from
codeandglobals(PyFunction_New). :type code:object:param code: :type globals:object:param globals:- Return type:
- picop.cyfunction.func_set_closure(op, closure)#
Set closure on
op(Noneor cell tuple).Notes
Returns
0on success; errors raise — do not use the status as a bool.