eval_dtype¶
- pyhelpers.ops.eval_dtype(str_val)[source]¶
Convert a string representation to its intrinsic data type.
- Parameters:
str_val (str) – String representation of a value.
- Returns:
Value converted to its intrinsic data type.
- Return type:
Any
Examples:
>>> from pyhelpers.ops import eval_dtype >>> val_1 = '1' >>> origin_val = eval_dtype(val_1) >>> origin_val 1 >>> val_2 = '1.1.1' >>> origin_val = eval_dtype(val_2) >>> origin_val '1.1.1'