MCPcopy Create free account
hub / github.com/python/mypy / is_same_group_module

Method is_same_group_module

mypyc/irbuild/builder.py:1161–1168  ·  view source on GitHub ↗

Is the given module in the same compilation group as the current module? Modules in the same group share a compiled C extension and can reference each other's C-level symbols directly. Modules in separate groups (separate compilation mode) must use the Python import system i

(self, module: str)

Source from the content-addressed store, hash-verified

1159 return self.mapper.is_native_module(module)
1160
1161 def is_same_group_module(self, module: str) -> bool:
1162 """Is the given module in the same compilation group as the current module?
1163
1164 Modules in the same group share a compiled C extension and can reference
1165 each other's C-level symbols directly. Modules in separate groups (separate
1166 compilation mode) must use the Python import system instead.
1167 """
1168 return self.mapper.group_map.get(module) == self.mapper.group_map.get(self.module_name)
1169
1170 def is_package_module(self, module: str) -> bool:
1171 """Is the given module a package (i.e., an __init__.py file)?"""

Callers 4

gen_importMethod · 0.95
transform_import_fromFunction · 0.80
classify_import_fromFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected