-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
acceptedReady for implementationReady for implementationruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
the case where an abstractmethod decorator is used on a class that does not subclass abc.ABC uses the ABC metaclass, is probably a bug. It would be great to have a rule to detect the obvious case where it is used on the wrong type of class (when all ancestors of the class in the same file for instance).
If there is a rule that already implements this, let me know. :)
Here is a real example from PyTorch:
class RemoteCacheBackend:
"""
A backend implementation for accessing a remote/distributed cache.
"""
def __init__(self, cache_id: str) -> None:
pass
@abstractmethod
def get(self, key: str) -> Optional[object]:
pass
@abstractmethod
def put(self, key: str, data: bytes) -> None:
passReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationruleImplementing or modifying a lint ruleImplementing or modifying a lint rule