To be able to annotate what types your list should accept, you need to use typing.List
from typing import List
So did you import List?
Update
If you’re using Python > 3.9, see @Adam.Er8’s answer
To be able to annotate what types your list should accept, you need to use typing.List
from typing import List
So did you import List?
Update
If you’re using Python > 3.9, see @Adam.Er8’s answer