Accessor to allow getting functions as attributes.
(self, name: str)
| 161 | return _ffi_api.ModuleImplementsFunction(self, name, query_imports) |
| 162 | |
| 163 | def __getattr__(self, name: str) -> core.Function: |
| 164 | """Accessor to allow getting functions as attributes.""" |
| 165 | try: |
| 166 | func = self.get_function(name) |
| 167 | except AttributeError as exc: |
| 168 | raise AttributeError(f"Module has no function '{name}'") from exc |
| 169 | setattr(self, name, func) |
| 170 | return func |
| 171 | |
| 172 | def get_function(self, name: str, query_imports: bool = False) -> core.Function: |
| 173 | """Get function from the module. |
nothing calls this directly
no test coverage detected