class Test: def __getitem__(self, arg): print(arg) test = Test() test[1] # 1 test[1:] # slice(1, None, None) test[1:3] # slice(1, 3, None) test[1:3:2] # slice(1, 3, 2) test['abc'] # abc test[...] # Ellipsis test[:, ...] # (slice(None, None, None), Ellipsis) test[::3, ...] # (slice(None, None, 3), Ellipsis) test[:, :, :] # (slice(None, None, None), slice(None, None, None), slice(None, None, None)) test[...] # Ellipsis test[1, 2, 3] # (1, 2, 3)