Functions
convert_param
2
str | int | float
▼
Convert a captured path parameter string to the target type.
Raises ``ValueErr…
convert_param
2
str | int | float
▼
def convert_param(value: str, param_type: str) -> str | int | float
Convert a captured path parameter string to the target type.
RaisesValueErrorif the string cannot be converted.
RaisesKeyErrorif param_type is not a registered converter.
Parameters
| Name | Type | Description |
|---|---|---|
value |
str |
|
param_type |
str |
Returns
str | int | float