MCPcopy
hub / github.com/python/mypy / read_literal

Function read_literal

mypy/cache.py:331–342  ·  view source on GitHub ↗
(data: ReadBuffer, tag: Tag)

Source from the content-addressed store, hash-verified

329
330
331def read_literal(data: ReadBuffer, tag: Tag) -> int | str | bool | float:
332 if tag == LITERAL_INT:
333 return read_int_bare(data)
334 elif tag == LITERAL_STR:
335 return read_str_bare(data)
336 elif tag == LITERAL_FALSE:
337 return False
338 elif tag == LITERAL_TRUE:
339 return True
340 elif tag == LITERAL_FLOAT:
341 return read_float_bare(data)
342 assert False, f"Unknown literal tag {tag}"
343
344
345# There is an intentional asymmetry between read and write for literals because

Callers 2

readMethod · 0.90
readMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…