Это мой код
Код: Выделить всё
from abc import ABC, abstractmethod
from typing import Any
class A(ABC):
@abstractmethod
def show(self, items: list[Any]):
pass
class B(A):
def show(self, items: list[int]):
print(items)
class Container:
def __init__(self, tmp: A):
self.t = tmp
def show(self, items):
self.t.show(items)
a = Container(B())
a.show([1.1, 2.0])
>>> [1.1, 2.0]
Я хочу, чтобы Ruff проверял тип перед его запуском.
Есть ли обходной путь?
надеюсь, мой вопрос ясен, заранее спасибо
Подробнее здесь: https://stackoverflow.com/questions/786 ... tion-class