Source code for superconfig.utilities.dtypes

[docs]class CallableConverter(type): def __call__(cls, val): return cls.convert(val)
[docs]class STR(metaclass=CallableConverter):
[docs] @staticmethod def convert(value): return str(value)
[docs]class INT(STR):
[docs] @staticmethod def convert(value): return int(value)
[docs]class FLOAT(STR):
[docs] @staticmethod def convert(value): return float(value)
[docs]class BOOL(STR):
[docs] @staticmethod def convert(value): return bool(value)