Skip to content

Commit

Permalink
feat: Add module load method to guppy
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Jan 19, 2024
1 parent bd4ff8b commit 95d11ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions guppylang/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ def dummy(*args: Any, **kwargs: Any) -> Any:

return dec

def load(self, m: ModuleType | GuppyModule) -> None:
caller = self._get_python_caller()
if caller not in self._modules:
self._modules[caller] = GuppyModule(caller.name)
module = self._modules[caller]
module.load(m)

def take_module(self, id: ModuleIdentifier | None = None) -> GuppyModule:
"""Returns the local GuppyModule, removing it from the local state."""
orig_id = id
Expand Down

0 comments on commit 95d11ba

Please sign in to comment.