Skip to content

[False positive] py/call-to-non-callable on _decorated_ __call__ magic methods #11408

Open
@amotl

Description

@amotl

Hi there,

thanks a stack for bringing LGTM to CodeQL. We used your kickstart template PR crate/crash#373 for making the transition happen on one of our Python repositories and wanted to report back about a potential false positive, after mitigating all other admonitions on our end before.

With kind regards,
Andreas.

Description of the false positive

py/call-to-non-callable is raised on decorated __call__ magic methods.

Code samples or links to source code

class FooBarCommand(Command):

    @noargs_command
    def __call__(self, cmd, *args, **kwargs):
        return f"{cmd}: foobar"

URL to the alert on GitHub code scanning (optional)

Thoughts

I wonder if anything can be done about it, other than manually dismissing corresponding admonitions? Do you have any other suggestions on this matter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions