Created
March 9, 2019 16:24
-
-
Save AdamGold/12572fcbd0c851195603fd84a1c9b1d4 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
In [2]: import typing | |
In [3]: class BetterLookingArticle(typing.NamedTuple): | |
...: title: str | |
...: id: int | |
...: description: str = "No description given." | |
...: | |
In [4]: BetterLookingArticle(title="Python is cool.", id=1) | |
BetterLookingArticle(title='Python is cool.', id=1, description='No description given.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment