ruff/crates/ruff_linter/resources/test/fixtures/pylint/singledispatchmethod_function.py
Aleksei Latyshev 0de23760ff
[pylint] Don't recommend decorating staticmethods with @singledispatch (PLE1519, PLE1520) (#10637)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-04-02 16:47:31 +00:00

23 lines
424 B
Python

from functools import singledispatchmethod
@singledispatchmethod # [singledispatchmethod-function]
def convert_position(position):
pass
class Board:
@singledispatchmethod # Ok
@classmethod
def convert_position(cls, position):
pass
@singledispatchmethod # Ok
def move(self, position):
pass
@singledispatchmethod # Ok
@staticmethod
def do(position):
pass