The implicit_coercion.py
module#
Summary#
Attempt to coerce the argument into the given type. |
|
Use to decorate functions using the PEP 484 typing system to try and coerce any |
Description#
Provides utilities for implicitly coercing arbitrary Python objects into the
appropriate IVariableValue
type.
Module detail#
- implicit_coercion.implicit_coerce_single(arg: Any, arg_type: type) Any #
Attempt to coerce the argument into the given type.
This function uses implicit semantics in that lossy conversions are not considered (such as int64->real64 because precision may be lost).
- implicit_coercion.implicit_coerce(func: Any) Any #
Use to decorate functions using the PEP 484 typing system to try and coerce any arguments that accept the
IVariableValue
type or any derived type into an acceptable value.- Parameters:
- func
Any
Function to decorate.
- func
- Returns:
Any
Wrapper function.