MCPcopy Index your code
hub / github.com/python/cpython / _HashInfoItem

Class _HashInfoItem

Lib/test/support/hashlib_helper.py:119–149  ·  view source on GitHub ↗

Interface for interacting with a named object. The object is entirely described by its fully-qualified *fullname*. *fullname* must be None or a string " . ".

Source from the content-addressed store, hash-verified

117
118
119class _HashInfoItem:
120 """Interface for interacting with a named object.
121
122 The object is entirely described by its fully-qualified *fullname*.
123
124 *fullname* must be None or a string "<module_name>.<member_name>".
125 """
126
127 def __init__(self, fullname=None, *, strict=False):
128 module_name, member_name = _parse_fullname(fullname, strict=strict)
129 self.fullname = fullname
130 self.module_name = module_name
131 self.member_name = member_name
132
133 def import_module(self, *, strict=False):
134 """Import the described module.
135
136 If *strict* is true, an ImportError may be raised if importing fails,
137 otherwise, None is returned on error.
138 """
139 return _import_module(self.module_name, strict=strict)
140
141 def import_member(self, *, strict=False):
142 """Import the described member.
143
144 If *strict* is true, an AttributeError or an ImportError may be
145 raised if importing fails; otherwise, None is returned on error.
146 """
147 return _import_member(
148 self.module_name, self.member_name, strict=strict
149 )
150
151
152class _HashInfoBase:

Callers 3

__init__Method · 0.85
__init__Method · 0.85
hashlib_helper.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…