From 12ce485b48430bdcf50b621e2e785c0079a7aebe Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Thu, 13 Dec 2001 19:47:02 +0000 Subject: [PATCH] Add helper macro to get the number of free variables for a PyCodeObject. --- Include/compile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Include/compile.h b/Include/compile.h index 296df90f325..0b1cb891ce6 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 */