-
-
Save Kangaroux/d2341c42d48c8cd312f3c8c409a3be40 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
# Declare a variable and use it later. | |
foo: int | |
# ... | |
foo = 5 | |
# Add type hints for function arguments and return types. | |
def say_hello(name: str) -> str: | |
return f"Hello {name}!" | |
# Declare fields on a class instead of using __slots__. | |
class MyClass: | |
field_a: str | |
field_b: bool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment