Python is dynamically typed. While Lucas R.'s answer is correct for the purpose of hinting like (which, in turn, can be used for static analysis and casting), strictly speaking, you do not need to do anything to do this work. Just create your lists like this and assign them to variables:
foo_table = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] bar_table = ... foo_database = [foo_table, bar_table, ...]
The types of hints are really useful, as they can help document how your code behaves, and they can be checked both statically and at runtime. But you have nothing to do if it is inconvenient.
source share