@
Python Tip #289 (of 365): Add context to exceptions with add_note. 🧵 def load_config(path): try: return json.loads(Path(path).read_text()) except json.JSONDecodeError as error: error.add_note(f"While parsing {path}") raise #Python #DailyPythonTip
@
🗺️ October 16, 2026 5/5 countries in 5/13 guesses 🟢🟢🟢🟢🟢 whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Ever wondered about the history of #Python's 2 modules for randomness? I wrote an article for LWN about that recently. It's now available for non-subscribers. https://lwn.net/Articles/1097468/
@
Python Tip #288 (of 365): Show a value's repr with "!r" in f-strings. 🧵 >>> name = "Trey" >>> print(f"Name: {name}") Name: Trey >>> print(f"Name: {name!r}") Name: 'Trey' #Python #DailyPythonTip
@
“When we pipe the output of this program to a file, by default, only the standard output stream will be piped to that file:” Read more 👉 https://pym.dev/standard-error/ #Python
@
🗺️ October 15, 2026 5/5 countries in 6/13 guesses 🟢🟢🟢🟡🟢 whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python 3.10 reached end of life a couple weeks ago. If you maintain a library and you're wondering what's in Python 3.11 that you can use, here's a cheat sheet. Upgrading to Python 3.14 because you like to stay one Python version behind at all times? This cheat sheet's for you too. #Python
@
Python Tip #287 (of 365): Read tracebacks from the bottom up. 🧵 When Python encounters an exception that isn't handled in your code, it prints out a traceback. #Python #DailyPythonTip
@
“If something feels more like a function than a class, we often just call it a function.” Read more 👉 https://pym.dev/class-or-function/ #Python
@
🗺️ October 14, 2026 5/5 countries in 6/13 guesses 🟢🟢🟡🟢🟢 whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
“You can use Python sets for removing duplicates, as long as you don't care about maintaining the order of your items.” Read more 👉 https://pym.dev/practical-uses-of-sets/ #Python
@
Python Tip #286 (of 365): Know your way around the Python docs. 🧵 The docs at docs.python.org/3/ have many different types of pages. It's helpful to note which kind of page you're on and consider whether you're in the right place. #Python #DailyPythonTip
@
🗺️ October 13, 2026 5/5 countries in 5/13 guesses 🟢🟢🟢🟢🟢 whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
🗺️ October 12, 2026 5/5 countries in 9/13 guesses 🟢🟡🟡🟠🟢 whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
How well do you know Python 3.15's new features? I made a quiz of some of my favorite features so you can test yourself. https://pym.dev/quiz/python-3.15/
@
Python Tip #285 (of 365): Learn to use the help function. 🧵 >>> help(print) Help on built-in function print in module builtins: print(*args, sep=' ', end='\n', file=None, flush=False) Prints the values to a stream, or to sys.stdout by default. ... #Python #DailyPythonTip
@
“Dictionaries are meant to make it easy to look up the value that corresponds to a particular key.” Read more 👉 https://pym.dev/using-dictionaries-in-python/ #Python