
# stupid emulation of a nice flag variable that can be
# set by simply calling it and used as a normal bool in ifs

class Flag(object):
    def __init__(self, initial=0):
        self.__value = initial
    def __call__(self):
        self.__value = 1
    def __nonzero__(self):
        return self.__value

enable_cool_features = Flag(False)

if enable_cool_features:
    print 'i am ready already (strange!)'
else:
    print 'I am not ready, waiting for set'

# set the flag
enable_cool_features()

if enable_cool_features:
    print 'Now, I am ready (as you want)'
else:
    print 'Something went completely wrong'

