What does it mean if a Python object is "subscriptable" or not?

Alistair picture Alistair · Oct 19, 2008 · Viewed 600.1k times · Source

Which types of objects fall into the domain of "subscriptable"?

Answer

mipadi picture mipadi · Oct 19, 2008

It basically means that the object implements the __getitem__() method. In other words, it describes objects that are "containers", meaning they contain other objects. This includes strings, lists, tuples, and dictionaries.