When I enable an interpreter feature in Python 2 with a from __future__ import X statement (e.g. from __future__ import unicode_literals), the interpreter behavior changes from there on out.
Is there a way, at runtime, to determine what __future__ pragmas have been enabled at a given point in execution?
The reason I want to do this is that some legacy code I maintain conditionally enables some __future__ pragmas before evaling/runtime-importing other arbitrary code. When debugging behavior issues in that code, I want to check whether it's because some of those conditional __future__ imports have been triggered or not. I know that conditionally importing __future__ (or importing it at anything other than the top of an entry point) is an antipattern and have no plans of spreading it; I just want to debug code that does this.
I've tried checking sys.modules, and using that I can tell that something from __future__ has been imported because the __future__ module shows up in the already-imported list. However, that's just the __future__ module, and the interpreter-behavior changes are not implemented as submodules, so I can't see which have been enabled or not.