Skip to content

Commit

Permalink
add asserts for hidden attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
savarin committed Feb 13, 2024
1 parent 16ed523 commit 255cad3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modal/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ async def lookup(
@property
def tag(self):
"""mdmd:hidden"""
assert hasattr(self, "_tag")
return self._tag

@property
Expand All @@ -1032,6 +1033,7 @@ def env(self) -> FunctionEnv:

def get_build_def(self) -> str:
"""mdmd:hidden"""
assert hasattr(self, "_raw_f") and hasattr(self, "_build_args")
return f"{inspect.getsource(self._raw_f)}\n{repr(self._build_args)}"

# Live handle methods
Expand Down

0 comments on commit 255cad3

Please sign in to comment.