(self, index)
Get item by index
Get item by index
Get item by index
def __getitem__(self, index):
        """Get item by index
        """
        def _getTextByIndex(blockIndex):
            return self._doc.findBlockByNumber(blockIndex).text()

        if isinstance(index, int):
            index = self._checkAndConvertIndex(index)
            return _getTextByIndex(index)
        elif isinstance(index, slice):
            start, stop, step = index.indices(self._doc.blockCount())
            return [_getTextByIndex(blockIndex) \
                        for blockIndex in range(start, stop, step)]
def __getitem__ ( self , index ) : def _getTextByIndex ( blockIndex ) : return self . _doc . findBlockByNumber ( blockIndex ) . text ( ) if isinstance ( index , int ) : index = self . _checkAndConvertIndex ( index ) return _getTextByIndex ( index ) elif isinstance ( index , slice ) : start , stop , step = index . indices ( self . _doc . blockCount ( ) ) return [ _getTextByIndex ( blockIndex ) for blockIndex in range ( start , stop , step ) ]