Modalities / modalities

Modalities, a PyTorch-native framework for distributed and reproducible foundation model training.
MIT License
63 stars 8 forks source link

Annotations: Adhere to PEP 604 / Leverage Built-In 3.10 Functionality #260

Open thomaschhh opened 1 month ago

thomaschhh commented 1 month ago

Feature request

Adjust type annotations so that they adhere to PEP 604 and to leverage Python 3.10 functionality.

def foo(data: dict[str, list[tuple[int, str]]]) -> dict[str, list[int | str]]:
    ...

instead of

from typing import Dict, List, Tuple, Union

def foo(data: Dict[str, List[Tuple[int, str]]]) -> Dict[str, List[Union[int, str]]]:
    ...

Motivation

Improves code readabilty and code quality.