diff Include/funcobject.h @ 40529:54cd47788811

PEP 3107 - Function Annotations thanks to Tony Lownds
author Neal Norwitz <nnorwitz@gmail.com>
date Thu, 28 Dec 2006 06:47:50 +0000
parents 1cce0526d9b0
children e70cdce0e8b2
line wrap: on
line diff
--- a/Include/funcobject.h	Thu Dec 28 04:47:50 2006 +0000
+++ b/Include/funcobject.h	Thu Dec 28 06:47:50 2006 +0000
@@ -30,6 +30,7 @@
     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(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 @@
 	(((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;