Код: Выделить всё
from typing import List
class Something:
class A:
def __init__(self, d: int) -> None:
self.data = d
class B:
def __init__(self, inListA: List[A]):
self.list_of_a = inListA
def __init__(self, inB: B):
self.data_b = inB
В def __init__(self, inB: B): принимается B.< /p>
Знаете ли вы, как правильно ввести inListA, чтобы он имел тип «список как»?
Подробнее здесь: https://stackoverflow.com/questions/671 ... onstructor
Мобильная версия