Question 6/30 fast.ai v3 lecture 10


What method do you need to define to make a Python object subscriptable?

Answer

__getitem__

Screenshot

supplementary material

You can read more about this method here. It falls under the category of methods that if defined implement container objects.