MCPcopy Index your code
hub / github.com/python/mypy / _read_and_set_import_metadata

Function _read_and_set_import_metadata

mypy/nativeparse.py:2018–2030  ·  view source on GitHub ↗
(data: ReadBuffer, stmt: Import | ImportFrom | ImportAll)

Source from the content-addressed store, hash-verified

2016
2017
2018def _read_and_set_import_metadata(data: ReadBuffer, stmt: Import | ImportFrom | ImportAll) -> None:
2019 read_loc(data, stmt)
2020
2021 # Metadata flags as a single integer bitfield
2022 flags = read_int(data)
2023
2024 # Extract individual flags using bitwise operations
2025 # Bit 0: is_top_level
2026 # Bit 1: is_unreachable
2027 # Bit 2: is_mypy_only
2028 stmt.is_top_level = (flags & 0x01) != 0
2029 stmt.is_unreachable = (flags & 0x02) != 0
2030 stmt.is_mypy_only = (flags & 0x04) != 0

Callers 2

read_statementFunction · 0.85
deserialize_importsFunction · 0.85

Calls 2

read_intFunction · 0.90
read_locFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…