Home / Companies / Pybites / Blog / April 2022

April 2022 Summaries

2 posts from Pybites

Filter
Month: Year:
Post Summaries Back to Blog
In the third installment of a series on Python type hints, the article explores more advanced examples to enhance understanding of type annotations, focusing on meaningful empty variables, class and instance variable annotations, and the use of type aliases to improve code readability. By illustrating how to annotate variables outside function definitions, the article emphasizes the clarity type hints bring, especially in revealing the structure and purpose of data, such as dictionaries or class attributes. It also discusses the use of typing.Union and typing.Optional to handle multiple types and None values, respectively, highlighting how these practices help prevent runtime errors and improve code reliability. The introduction of Python 3.10's TypeAlias is presented as a more explicit way to declare type aliases, further enhancing static type checking and code comprehension. The article concludes by inviting readers to engage with the author for further discussions on type hints and related topics.
Apr 08, 2022 2,208 words in the original blog post.
Feeling drained after a long day at work and struggling to find energy for personal projects is a common experience, yet the "40% Rule" from the US Navy SEALs suggests that when you feel exhausted, you still have 60% of your energy left. The author explores this idea by recommending a technique learned from writing coach Beth Barany, which involves committing to work on a project for just five minutes. This brief period can help overcome mental barriers and potentially spark motivation, leading to a more extended and productive session if the energy allows. The approach emphasizes recognizing personal limits and not feeling guilty for resting when truly fatigued, while also highlighting the potential for unexpected productivity once initial resistance is overcome.
Apr 01, 2022 460 words in the original blog post.