infer_to_python
No overview available.
def infer_to_python(
value: str
) - > Any
Infers the Python data type from a string representation and converts it to the corresponding Python object. This is useful for parsing configuration values or user input where types like integers, booleans, or floats are represented as strings.
Parameters
| Name | Type | Description |
|---|---|---|
| value | str | The string value to be analyzed and converted into a native Python type. |
Returns
| Type | Description |
|---|---|
Any | The converted Python object (int, float, bool, or None) if a match is found; otherwise, the original string. |