MCPcopy Create free account
hub / github.com/twisted/twisted / namedModule

Function namedModule

src/twisted/python/reflect.py:152–161  ·  view source on GitHub ↗

Return a module given its name.

(name)

Source from the content-addressed store, hash-verified

150
151
152def namedModule(name):
153 """
154 Return a module given its name.
155 """
156 topLevel = __import__(name)
157 packages = name.split(".")[1:]
158 m = topLevel
159 for p in packages:
160 m = getattr(m, p)
161 return m
162
163
164def namedObject(name):

Callers 6

test_supportsThreadsMethod · 0.90
opt_help_reactorsMethod · 0.90
_wrappedPdbFunction · 0.90
test_xmlrpc.pyFile · 0.90
namedObjectFunction · 0.85
requireModuleFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_supportsThreadsMethod · 0.72