Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Self-Documenting Debugging in Python
February 12, 2026
Most Python developers are familiar with f-strings, but there is a hidden shorthand that is a lifesaver for debugging. Instead of writing print(f'user_id: {user_id}'), you can simply write print(f'{user_id=}'). By adding that equal sign inside the curly braces, Python will automatically output both the variable name and its current value.
This is a small but mighty trick that keeps your debug logs organized without the manual effort of labeling every print statement. It’s especially useful when you're quickly checking the state of multiple variables and want to avoid the confusion of seeing a wall of unlabeled numbers in your terminal.