MCPcopy Index your code
hub / github.com/python/cpython / peek

Method peek

Tools/cases_generator/plexer.py:41–45  ·  view source on GitHub ↗
(self, raw: bool = False)

Source from the content-addressed store, hash-verified

39 return None
40
41 def peek(self, raw: bool = False) -> Token | None:
42 # Return next token without advancing position
43 tok = self.next(raw=raw)
44 self.backup()
45 return tok
46
47 def maybe(self, kind: str, raw: bool = False) -> Token | None:
48 # Return next token without advancing position if kind matches

Callers 10

maybeMethod · 0.95
make_syntax_errorMethod · 0.95
deopt_ifMethod · 0.45
error_ifMethod · 0.45
parse_filesFunction · 0.45
inst_headerMethod · 0.45
expressionMethod · 0.45
membersMethod · 0.45
exit_ifMethod · 0.45
exit_if_afterMethod · 0.45

Calls 2

nextMethod · 0.95
backupMethod · 0.95

Tested by

no test coverage detected