diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-12-28 06:47:50 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-12-28 06:47:50 +0000 |
commit | c150536b5efadf71fcb4187cad7258be7268e157 (patch) | |
tree | aeb17f5e0ecc6cc8ccdecb2b64e3f46a0a3af85c /Include/funcobject.h | |
parent | f6657e67b3cf89649d14d9012b3964a3490d45b0 (diff) | |
download | cpython-git-c150536b5efadf71fcb4187cad7258be7268e157.tar.gz |
PEP 3107 - Function Annotations thanks to Tony Lownds
Diffstat (limited to 'Include/funcobject.h')
-rw-r--r-- | Include/funcobject.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/funcobject.h b/Include/funcobject.h index 7acbe6e7c1..5739dd65be 100644 --- a/Include/funcobject.h +++ b/Include/funcobject.h @@ -30,6 +30,7 @@ typedef struct { PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ PyObject *func_weakreflist; /* List of weak references */ PyObject *func_module; /* The __module__ attribute, can be anything */ + PyObject *func_annotations; /* Annotations, a dict or NULL */ /* Invariant: * func_closure contains the bindings for func_code->co_freevars, so @@ -52,6 +53,8 @@ PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *); PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *); +PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ @@ -67,6 +70,8 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); (((PyFunctionObject *)func) -> func_kwdefaults) #define PyFunction_GET_CLOSURE(func) \ (((PyFunctionObject *)func) -> func_closure) +#define PyFunction_GET_ANNOTATIONS(func) \ + (((PyFunctionObject *)func) -> func_annotations) /* The classmethod and staticmethod types lives here, too */ PyAPI_DATA(PyTypeObject) PyClassMethod_Type; |