yesno
Given a string mapping values for true, false, and (optionally) None, return one of those strings according to the value:
========== ====================== ==================================
Value Argument Outputs
========== ====================== ==================================
``True`` ``"yeah,no,maybe"`` ``yeah``
``False`` ``"yeah,no,maybe"`` ``no``
``None`` ``"yeah,no,maybe"`` ``maybe``
``None`` ``"yeah,no"`` ``"no"`` (converts None to False
if no mapping for None is given.
========== ====================== ==================================
def yesno(
value: any,
arg: string = None
) - > string
Given a string mapping values for true, false, and (optionally) None, return one of those strings according to the value.
Parameters
| Name | Type | Description |
|---|---|---|
| value | any | The input value to be evaluated for truthiness or nullity. |
| arg | string = None | A comma-separated string defining the mappings for true, false, and optionally None (e.g., "yes,no,maybe"). |
Returns
| Type | Description |
|---|---|
string | The mapped string corresponding to the truthiness of the input value, or the original value if the argument format is invalid. |