Are you re-raising exceptions just to add extra context? Since Python 3.11 you can attach notes to exceptions instead #PythonDev #python
Notes tagged "#python"
8 notes filed under this tag.
#PythonDev #python
“pythonkoans.substack.com/p/koan-15-th...”
#PythonDev #python
“open.substack.com/pub/pythonko...”
#python uses the flyweight design pattern to intern strings
#python sets are useful when you need: - fast membership testing - deduplication or uniqueness guarantees - comparing two sets of items
#python list tips: - reversed(list) is more memory efficient for reversing a list than slicing list[::-1] because it returns an iterator instead of a copy - You can remove multiple items with slice assignment using list[1:4] = [] or del a[1:4]
#python variable scoping can be confusing if you’re used to other programming languages. A scope determines where a variable name is visible, and it’s lifetime. Python checks for the variable definition in the following order, and stops at the first match
It’s been a fun July writing Python Koans, I’m hoping to carry this momentum for the rest of the year! If you have suggestions or topics you want me to cover, feel free to DM me! #python pythonkoans.substack.com
Python Koans | Vivis Dev | Substack pythonkoans.substack.com / https://pythonkoans.substack.com Python lessons wrapped in koans. Small puzzles, deep truths. Not your usual tutorial thread. Click to read Python Koans, by Vivis Dev, a Substack publication with hundreds of subscribers.