Код: Выделить всё
class A(metaclass=AllStatic):
def inc(x): # no need for @staticmethod
return x + 1
Есть есть ли способ как-то аннотировать inc, чтобы предупреждение исчезло?
Я пробовал использовать файл-заглушку, но это не помогло:
Код: Выделить всё
class A:
@staticmethod
def inc(x): ...
# also this
class A:
inc: staticmethod
Подробнее здесь: https://stackoverflow.com/questions/661 ... -stub-file