Skip to content

Instantly share code, notes, and snippets.

@goksu

goksu/app.py Secret

Created August 22, 2021 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goksu/7aca3878012e617a0305badcdaa3a3e6 to your computer and use it in GitHub Desktop.
Save goksu/7aca3878012e617a0305badcdaa3a3e6 to your computer and use it in GitHub Desktop.
def adjust_state(state: State) -> None:
...
def process(val: int, state: Optional[State] = None) -> ProcessResult:
...
# A functionality that assumes state to be passed in.
assert state
adjust_state(state)
def app():
process(10)
# ^ No typing errors here, no signals that process technically
# requires a state object to be defined before called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment