def foo(x: str = 'bar') -> None:
"""[summary]
Parameters
----------
x : str, optional
[description], by default 'bar'
"""
print(x)
raises
DAR103 Parameter type mismatch: ~x: expected str but was str, optional
when <type>, optional is the numpydoc way of indicating that the given parameter is optional and has a default value. Darglint might be interpreting it as corresponding to a typing.Optional type definition - which in this case is not actually appropriate.
raises
DAR103 Parameter type mismatch: ~x: expected str but was str, optional
when
<type>, optional
is the numpydoc way of indicating that the given parameter is optional and has a default value. Darglint might be interpreting it as corresponding to atyping.Optional
type definition - which in this case is not actually appropriate.