summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-12-13 19:47:02 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-12-13 19:47:02 (GMT)
commit12ce485b48430bdcf50b621e2e785c0079a7aebe (patch)
tree2b1effd3ee2fd4d73e412b62b940c19aaa46ff1d
parentccae8377a329fe60193a605697b5ffefb4734960 (diff)
downloadcpython-12ce485b48430bdcf50b621e2e785c0079a7aebe.zip
cpython-12ce485b48430bdcf50b621e2e785c0079a7aebe.tar.gz
cpython-12ce485b48430bdcf50b621e2e785c0079a7aebe.tar.bz2
Add helper macro to get the number of free variables for a PyCodeObject.
-rw-r--r--Include/compile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/compile.h b/Include/compile.h
index 296df90..0b1cb89 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -46,6 +46,7 @@ typedef struct {
extern DL_IMPORT(PyTypeObject) PyCode_Type;
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
+#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */