mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00

## Summary Implement `singledispatchmethod-function` from pylint, part of #970. This is essentially a copy paste of #8934 for `@singledispatchmethod` decorator. ## Test Plan Text fixture added.
23 lines
453 B
Python
23 lines
453 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 # [singledispatchmethod-function]
|
|
@staticmethod
|
|
def do(position):
|
|
pass
|