MCPcopy
hub / github.com/waditu/tushare / peek

Method peek

tushare/util/demjson.py:1656–1666  ·  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

1654 return helpers.char_is_json_eol(c)
1655
1656 def peek( self, offset=0 ):
1657 """Returns the character at the current position, or at a
1658 given offset away from the current position. If the position
1659 is beyond the limits of the document size, then an empty
1660 string '' is returned.
1661
1662 """
1663 i = self.cpos + offset
1664 if i < 0 or i >= self.__cmax:
1665 return ''
1666 return self.__rawbuf[i]
1667
1668 def peekstr( self, span=1, offset=0 ):
1669 """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