To achieve this, I use a generic, which is done with a TypeVar in Python: from typing import TypeVar T = TypeVar('T') def reverse(coll: list[T]) -> list[T]: ...
確定! 回上一頁