News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by int_19h on Friday April 22, 2022 @08:17PM (#31129923)
It is a silly type for a function to return, because you have three levels of data structure nesting, with not one bit of information about the meaning of any of the values except their types. If I call your function and then do result[1][2], what does that mean?

This is exactly the kind of situation where you're supposed to use a named tuple or a data class to make it clear what's what.

Re:Python’s “type hints” are a bit of a disappointment to me by wheelerof4te on Saturday April 23, 2022 @05:26PM (#31138747)
With tuples inside of lists, you usually unpack them to variables in a for loop.

Named tuples are just immutable classes with slots. Unless you want to slow your code down considerably, it's best to avoid them.