Skip to content

with_annotated and with_argparse decorators do not work with staticmethod #1683

@neoniobium

Description

@neoniobium

Problem

with_annotated and with_argparser decorators do not work with the builtin staticmethod decorator.

How to reproduce

class Failed(Cmd):

    @with_annotated
    @staticmethod
    def do_a(...) -> None:
        ...

    @with_argparser
    @staticmethod
    def do_b(...) -> None:
        ...

Expected behavior

Both decorated methods can be declared without a self argument by using the staticmethod decorator for at least one order of decorators.

Actual behavior

Calling booth methods fail with different errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions