use native types List->list, Dict->dict, Set->set, Tuple->tuple

This commit is contained in:
Andreas Koepf 2025-02-21 15:13:19 +01:00
parent 5d02064b5a
commit 3e7ff3b084
95 changed files with 754 additions and 760 deletions

View file

@ -2,7 +2,7 @@
from dataclasses import dataclass
from random import Random
from typing import List, Optional, Tuple
from typing import Optional
from ..factory import ProceduralDataset, register_dataset
@ -46,7 +46,7 @@ Please follow the instruction below:
# Reparse to ensure exact decimal representation
return f"{float(formatted):.{decimals}f}"
def _generate_numbers(self, rng: Random) -> Tuple[List[float], List[str]]:
def _generate_numbers(self, rng: Random) -> tuple[list[float], list[str]]:
"""Generate list of numbers and their string representations"""
count = rng.randint(self.config.min_numbers, self.config.max_numbers)
decimals = rng.randint(self.config.min_decimals, self.config.max_decimals)