Created
April 18, 2021 11:27
-
-
Save Naartti/a8bd28903c3d683a77d76b049eadd66b to your computer and use it in GitHub Desktop.
Typed Python function with optional parameters
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
from typing import Optional | |
def optional_foo(bar: Optional[str]): | |
return bar or "No input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment