MCPcopy
hub / github.com/tkfy920/qstock / peek

Method peek

data/demjson.py:1780–1790  ·  view source on GitHub ↗

Returns the character at the current position, or at a given offset away from the current position. If the position is beyond the limits of the document size, then an empty string '' is returned.

(self, offset=0)

Source from the content-addressed store, hash-verified

1778 return helpers.char_is_json_eol(c)
1779
1780 def peek(self, offset=0):
1781 """Returns the character at the current position, or at a
1782 given offset away from the current position. If the position
1783 is beyond the limits of the document size, then an empty
1784 string '' is returned.
1785
1786 """
1787 i = self.cpos + offset
1788 if i < 0 or i >= self.__cmax:
1789 return ''
1790 return self.__rawbuf[i]
1791
1792 def peekstr(self, span=1, offset=0):
1793 """Returns one or more characters starting at the current

Callers 15

at_endMethod · 0.95
at_wsMethod · 0.95
at_eolMethod · 0.95
skipuntilMethod · 0.95
skip_to_next_lineMethod · 0.95
popMethod · 0.95
popifMethod · 0.95
pop_while_inMethod · 0.95
pop_identifierMethod · 0.95
__getitem__Method · 0.95
recover_parserMethod · 0.80
decode_numberMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected