## On This Day... ```dataview LIST FROM "DevLog/log" WHERE dateformat(file.day, "MM-dd") = dateformat(this.file.day, "MM-dd") ``` --- ## Notes Created Today ```dataview TABLE created, updated as modified, tags, type, status FROM "DevLog" AND !"DevLog/log" WHERE contains(dateformat(file.ctime, "YYYY-MM-dd"), dateformat(this.file.day, "YYYY-MM-dd")) ``` --- [[DevLog/log/2021-06-15|2021-06-15]] <== <button class="date_button_today">Today</button> ==> [[DevLog/log/2021-06-17|2021-06-17]] - [TALK / Meredydd Luff / Writing Good Documentation for Developers](https://youtu.be/eWaWvUhpseM?list=PL2Uw4_HvXqvYk1Y5P8kryoyd83L_0Uk5K) - [TALK / Mariatta Wijaya / Oops! I Became an Open Source Maintainer!](https://youtu.be/iPs64t1nsSM?list=PL2Uw4_HvXqvYk1Y5P8kryoyd83L_0Uk5K) - [[pytest]] - [TUTORIAL / Moshe Z / Python Unit Testing with Pytest and Mock](https://youtu.be/DJoffYEPttY?list=PL2Uw4_HvXqvYk1Y5P8kryoyd83L_0Uk5K) - [Python Features You Probably Don’t Know About, But Should](https://levelup.gitconnected.com/python-features-you-probably-dont-know-about-but-should-a66c6b30c528) ## Named Tuples ```python from collections import namedtuple Coordinate = namedtuple("Coordinate", "longitude latitude") location = Coordinate(90, 37.5) print("location:", location) # accessing attributes with dot notation print(location.longitude, location.latitude) # Output: # location: Coordinate(longitude=90, latitude=37.5) # (90, 37.5) ``` ## For ... Else ```python #case 1 for letter in 'foo': print(letter) else: print("All letters have been printed") #case 2 for letter in 'foo': print(letter) if letter == 'o': break else: print("Letters have been printed") # Output: # case 1 # f # o # o # All letters have been printed # case 2 # f # o ``` ## enums with the [[enum]] module ```python from enum import Enum Season = Enum('Season', 'winter summer spring autumn') print(Season.summer.name) print(Season.summer.value) #using class class Season(Enum): winter = 1 summer = 2 spring = 3 autumn = 4 print(Season.winter.name) print(Season.winter.value) # Output: # summer # 2 # winter # 1 ``` - [[Python]] [[black]] [[flake8]] [[isort]] <https://medium.com/staqu-dev-logs/keeping-python-code-clean-with-pre-commit-hooks-black-flake8-and-isort-cac8b01e0ea1> [[DevLog/s/l/python/workflow]]