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

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_weakreflist
PyObject* func_weakreflist;

List of weak references

Meta