How to indicate that an argument is a list of lists

Viewed 725
In order to indicate that an argument is a list one can use:
def fun(words:list):
    code...

How can I indicate that an argument should be a list of lists? All I can think about is doing something like this:

def fun(words:(list,list)):
    code...

Would that be understandable?

1 Answers

You could use the typing module:

from typing import List

def fun(l: List[list]):
    code...
Related