_flags module

pyflyby._flags.CompilerFlags(*args)

Representation of Python “compiler flags”, i.e. features from __future__.

>>> print(CompilerFlags(0x18000).__interactive_display__()) 
CompilerFlags(0x18000) # from __future__ import with_statement, print_function
>>> print(CompilerFlags(0x10000, 0x8000).__interactive_display__()) 
CompilerFlags(0x18000) # from __future__ import with_statement, print_function
>>> print(CompilerFlags('with_statement', 'print_function').__interactive_display__()) 
CompilerFlags(0x18000) # from __future__ import with_statement, print_function
>>> compile("print('x', file=None)", "?", "exec", flags=CompilerFlags("print_function"), dont_inherit=1) 
<code object ...>