Appending | None if a doctype is marked as "optional" is only correct if the default is actually None. E.g.
def foo(a=None, b=1):
"""
Parameters
----------
a : str, optional
b : int, optional
"""
should be transformed to
def foo(a: str | None = None, b: int = ...) -> None: ...
Appending
| Noneif a doctype is marked as "optional" is only correct if the default is actuallyNone. E.g.should be transformed to