code: def type(self):
          
          if self.orig_type is TRISTATE and \
             ((self.choice and self.choice.tri_value == 2) or
              not self.kconfig.modules.tri_value):
  
              return BOOL
  
          return self.orig_type
docs: See the class documentation.