Skip to content

Python FP when using multiple decorators on class function #1902

Open
@Anthchirp

Description

@Anthchirp

In https://lgtm.com/projects/g/dials/dials/snapshot/5c386da2f97d98b7ec80e34cec0cbf894fce6a36/files/util/filter_reflections.py?sort=name&dir=ASC&mode=heatmap#L288 a function is defined as:

class X:
  @staticmethod
  @seconddecorator
  def function(parameter):

Due to the presence of the decorator @seconddecorator the type of parameter is inferred to be instances of X. This is of course not true due to the @staticmethod decorator being present.
This can then lead to false positives on operations on parameter further down the line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions