PyFunctionObject

subclass of PyObject

Invariant: func_closure contains the bindings for func_code->co_freevars, so PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0).

Members

Mixins

__anonymous
mixin PyObject_HEAD
Undocumented in source.

Variables

func_annotations
PyObject* func_annotations;

Annotations, a dict or NULL Availability: 3.*

func_closure
PyObject* func_closure;

NULL or a tuple of cell objects

func_code
PyObject* func_code;

A code object

func_defaults
PyObject* func_defaults;

NULL or a tuple

func_dict
PyObject* func_dict;

The __dict__ attribute, a dict or NULL

func_doc
PyObject* func_doc;

The __doc__ attribute, can be anything

func_globals
PyObject* func_globals;

A dictionary (other mappings won't do)

func_kwdefaults
PyObject* func_kwdefaults;

NULL or a dict Availability: 3.*

func_module
PyObject* func_module;

The __module__ attribute, can be anything

func_name
PyObject* func_name;

The __name__ attribute, a string object

func_qualname
PyObject* func_qualname;
Undocumented in source.
func_weakreflist
PyObject* func_weakreflist;

List of weak references

vectorcall
vectorcallfunc vectorcall;

Availability: >= 3.8

Mixed In Members

From mixin PyObject_HEAD

__anonymous
mixin _PyObject_HEAD_EXTRA
Undocumented in source.
ob_refcnt
Py_ssize_t ob_refcnt;

_

ob_type
PyTypeObject* ob_type;

_

Meta