Код: Выделить всё
def comma_separated_list_ex[T: Lexeme](self, typ: type[T] | tuple[type[T], ...], fin: type[Lexeme]) -> tuple[
list[T], Lexeme]:
...
Проблема, с которой я столкнулся, заключается в том, что pycharm говорит, что comma_separated_list_ex(SomeLexemeSubclass, LexemeSubclass) верен, но выдает ошибку ввода для comma_separated_list_ex((SomeLexemeSubclass, AnotherLexemeSubclass), LexemeSubclass) очевидно, что предоставленные мной подсказки типов неверны. Описание ошибки
Код: Выделить всё
Expected type 'type[SomeLexemeSubclass] | tuple[type[SomeLexemeSubclass], ...]' (matched generic type 'type[T ≤: Lexeme] | tuple[type[T ≤: Lexeme], ...]'), got 'tuple[type[SomeLexemeSubclass], type[AnotherLexemeSubclass]]' instead
Мобильная версия