Skip to content

argparse.ArgumentParser.parse_args() overload misfire #2641

Closed
@gvanrossum

Description

@gvanrossum

I had some code calling parse_args(args, ns) where the type of ns was Optional[Namespace. It then deduced that the return type was also Optional[Namespace]. I think this is a mistake -- I don't think parse_args() ever returns None. Perhaps _N should be constrained by bound='Namespace'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: false negativeType checkers do not report an error, but should

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions