Skip to content

| None is applied to optional parameters when not appropriate #13

@lagru

Description

@lagru

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: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions