Skip to content

False Negative - Python abc.ABC makes method's getACall unavailable #18725

Open
@fubuki8087

Description

@fubuki8087

If we have this Python code:

class MyClass():
    def method(self):
        print("xxx")
    def wrapper(self):
        self.method()

mc = MyClass()
mc.method()

and this query:

import python

from PythonFunctionValue method
select method.getACall()

It's OK that self.method() and mc.method() will be marked as positive.

However, those will be false negative as long as the class MyClass inherits abc.ABC. It looks like:

from abc import ABC

class MyClass(ABC):
    def method(self):
        print("xxx")
    def wrapper(self):
        self.method()

mc = MyClass()
mc.method()

Why does the abc.ABC make the result wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions