

def __getitem__(self, key):
    "\n        Allows slicing. Returns an OrderedDict if you slice.\n        >>> b = OrderedDict([(7, 0), (6, 1), (5, 2), (4, 3), (3, 4), (2, 5), (1, 6)])\n        >>> b[::-1]\n        OrderedDict([(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1), (7, 0)])\n        >>> b[2:5]\n        OrderedDict([(5, 2), (4, 3), (3, 4)])\n        >>> type(b[2:4])\n        <class '__main__.OrderedDict'>\n        "
    if isinstance(key, slice):
        keys = self._sequence[key]
        return OrderedDict([(entry, self[entry]) for entry in keys])
    else:
        return dict.__getitem__(self, key)

dataset/ETHPy150Open editorconfig/editorconfig-vim/plugin/editorconfig-core-py/editorconfig/odict.py OrderedDict.__getitem__/original