class FoodsList(list):
    pass

def eat(foods):
    """
    :type foods: FoodsList
    """
energy = 0
for food in foods:
    energy += food.calories
return energy
list = FoodsList()
list.append(Food(3))
list.append(Food(4))
print(eat(list))
How to specify that a parameter is a list of specific objects in Python docstrings