Created
May 31, 2020 15:20
-
-
Save highsmallxu/a7acb19869d7867c92736f42277eb5de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import collections | |
ArticleNamedTuple = collections.namedtuple("ArticleNamedTuple", ["date", "writer"]) | |
class ArticleAdvancedNamedTuple(ArticleNamedTuple): | |
__slots__ = () | |
article = ArticleAdvancedNamedTuple("2020-01-01", "xiaoxu") | |
print(article.writer) | |
# xiaoxu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment