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

Method get_module

mypyc/irbuild/builder.py:548–552  ·  view source on GitHub ↗
(self, module: str, line: int)

Source from the content-addressed store, hash-verified

546 self.add_bool_branch(comparison, out, needs_import)
547
548 def get_module(self, module: str, line: int) -> Value:
549 # Python 3.7 has a nice 'PyImport_GetModule' function that we can't use :(
550 mod_dict = self.call_c(get_module_dict_op, [], line)
551 # Get module object from modules dict.
552 return self.primitive_op(dict_get_item_op, [mod_dict, self.load_str(module, line)], line)
553
554 def get_module_attr(self, module: str, attr: str, line: int) -> Value:
555 """Look up an attribute of a module without storing it in the local namespace.

Callers 2

get_module_attrMethod · 0.95

Calls 3

call_cMethod · 0.95
primitive_opMethod · 0.95
load_strMethod · 0.95

Tested by

no test coverage detected