I was looking at the codetype object, and in particular the co_flags attribute.
I wrote a tiny function
def f(a,b,c,*args):
print a,b,c,args
Which was compiled to a codetype object. examining the codetype object, the container (the outer codetype) co_flag is set to 64, the function (the inner codetype) is 71
According to the docs 0x40 (64) is set if the function has variable args (eg *args) and that bit is set on the outer and inner codetype objects.
I'm just wondering
- why the container is set to 64 as all it does is set functions up eg there is no variable arguments used?
- what the other bits in the function codetype co_flags do?
Is there a comprehensive list of the various flags as the documentation alludes to 'reserved for internal use' but nothing else is mentioned?
I'm using python 2.7.10