Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

change index function for class python

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
        ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #index #function #class #python
ADD COMMENT
Topic
Name
2+9 =