Created
February 17, 2020 09:37
-
-
Save yatakeke/41e1623086b698a8a018938536a185d1 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
from typing import NamedTuple | |
class PathContainer(NamedTuple): | |
root: str | |
document: str | |
exe: str | |
path_container = PathContainer("root_path","document_path","exe_path") | |
# immutableだけど各要素に名前でアクセスできるのが良い点 | |
# defaultで値も設定できる | |
# reference JP : https://qiita.com/Seny/items/add4d03876f505442136 | |
# reference EN : https://dbader.org/blog/writing-clean-python-with-namedtuples |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment