How would one tell at runtime if a particular feature has been enabled by
the "from __future__ import thing" statement?

For example, I can do this:

if 1/2 == 0: 
    print "classic division in use"
else:
    print "true division in use"


I could even do this:

from keyword import keyword
if keyword("with"):
    print "with statement enabled"
else:
    print "with statement not enabled"

(I don't especially care whether the feature in question has been enabled
via an explicit call to import, or because it has become the default.)

Is there any general mechanism? 


-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to