Interface for interacting with a named object. The object is entirely described by its fully-qualified *fullname*. *fullname* must be None or a string " . ".
| 117 | |
| 118 | |
| 119 | class _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 | |
| 152 | class _HashInfoBase: |
no outgoing calls
no test coverage detected
searching dependent graphs…