It seems to me that in very many cases, we don’t actually need multiple types in the docs. For the examples here, something like this could work:
some_func(p, timeout=None)
- p: number – A parameter that takes an
int
or afloat
argument. ADecimal
will work too, we’re not picky.- timeout: number – A timeout in seconds for blocking operations like connect(). If omitted (or
None
), use the global default timeout settings.
IOW, the “or None” spelling of “optional” is best left to automated tools.