wojtask / clrs4e-implementations

Implementations of algorithms and data structures from "Introduction to Algorithms", Fourth Edition by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein
GNU General Public License v3.0
4 stars 0 forks source link

Improve type hints #240

Open wojtask opened 5 months ago

wojtask commented 5 months ago

Python 3.8 doesn't support subscriptable type hints, e.g., List[str] or Set[Chip].

image

Once Python 3.8 reaches end of life in Oct 2024, and once disabling it in build.yml, type hints can be improved. Try making Array or other data structures type-parameterized, so we can also use e.g., Array[int] as type hint.

Also, decide if we need type hints in double undescored functions as well.

wojtask commented 5 months ago

After another failure caused by Python 3.8 lack of support for used function, I've rushed the decision of removing 3.8, and adding 3.12. This means the issue is now unblocked.