-
-
Save goksu/7aca3878012e617a0305badcdaa3a3e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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