code: def _enforceDataType(self, data):
          
          idx = int(data)
          if idx < 0:
              idx += len(self._displayValues)
          assert 0 <= idx < len(self._displayValues), \
              "Index should be >= 0 and < {}. Got {}".format(len(self._displayValues), idx)
          return idx
docs: Converts to int so that this CTI always stores that type.
  
              The data be set to a negative value, e.g. use -1 to select the last item
              by default. However, it will be converted to a positive by this method.