Class indexing

Code examples

0
0

class indexing

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

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................