📜  类索引 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:51.793000             🧑  作者: Mango

代码示例1
class indexed_array:
    def __getitem__(self, indices):
        # convert a simple index x[y] to a tuple for consistency
        if not isinstance(indices, tuple):
            indices = tuple(indices)

        # now handle the different dimensional cases