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

Method peek_string

Lib/_pyrepl/_module_completer.py:499–502  ·  view source on GitHub ↗
(self, string: str)

Source from the content-addressed store, hash-verified

497 return tok.string
498
499 def peek_string(self, string: str) -> bool:
500 if not (tok := self.peek()):
501 return False
502 return tok.string == string
503
504 def pop_string(self, string: str) -> str:
505 tok = self.pop()

Callers 7

parse_importMethod · 0.80
parse_from_importMethod · 0.80
parse_dotted_as_nameMethod · 0.80
parse_dotted_nameMethod · 0.80
parse_as_namesMethod · 0.80
parse_as_nameMethod · 0.80

Calls 1

peekMethod · 0.95

Tested by

no test coverage detected