vinegar.transform.misc¶
Miscellaneous transformations.
This are transformations that do not fit into another module, but do not warrant a separate module either.
- vinegar.transform.misc.to_int(value: Any, raise_error_if_malformed: Literal[True]) int¶
- vinegar.transform.misc.to_int(value: ArgumentT, raise_error_if_malformed: bool) ArgumentT | int
Return integer representation of the value.
When a value that cannot be converted to an
intis encountered, the behavior depends on theraise_error_if_malformedoption. If that option is set toTrue, aValueErroris raised. If it isFalse(the default), the input value is returned unchanged.- Parameters:
value – value to be transformed.
- Returns:
int(value).