π‘ Python radar - June/July 2023
A personal selection of Python-related news and projects that caught my attention this month (note: leading emojis are mine).
PS: I'm putting aside the news about Large Language Models (LLM) for now; there are some very interesting things (open models, local execution, embeddings), but there is a profusion of tools/libs/packages, and it's all over the place. Let's wait for the dust to settle a bitβ¦
π₯ PyCon US 2023 (youtube.com)
The videos of the keynotes, talks, and tutorials from the annual Python conference PyCon US are available.
πΌ SQL Databases with Pandas and Python (youtube.com)
A video by our colleague Rob Mulla explaining how to interact with an SQL database directly from Pandas; it can be very convenient.
β‘ AsyncIO: Why I Hate it (charlesleifer.com)
A frank opinion on the Python API asyncio and why it is preferable to use an alternative like gevent.
β οΈ Using and Creating Global Variables (realpython.com)
To thoroughly understand the concepts of "scope" of variables and the impact of using global variables in your code (hint: not good).
π§ What's the Zen of Python? (realpython.com)
An attempt to elucidate the famous "Zen of Python"; if you don't know it, type "import this" in a Python console!
π§ͺ pytest fixtures are magic! (revsys.com)
An article that will allow you to appreciate the power of "fixtures" in pytest, with a special mention for the "built-in fixtures" at the end of the article.
π¨ Python's raise: Effectively Raising Exceptions in Your Code (realpython.com)
A great article from Real Python on exception management and best practices to adopt, must read.
π Why and how to hide the Python stack trace (bitecode.dev)
Or how to intercept a "crash" of your program to display a more friendly message to your users, for example to generate a "crash report" with instructions to report the error (bonus: the CrashHandler from the IPython project).
π’ When NumPy is too slow (pythonspeed.com)
Some tips to speed up your NumPy code, and an important point: donβt rush into parallelizing your code; there are other optimization methods to explore first.
π 7 Ways to Share a Numpy Array Between Processes (superfastpython.com)
Okay, if you really need to parallelize your NumPy code, you can take a look at this article showing various ways to do it.
π Comprehensive Python Cheatsheet (gto76.github.io)
A monumental "cheatsheet" for Python! Add it to your favorites.
ποΈ Kraken Technologies: How we organize our very large Python monolith (europython.eu)
An interesting read from which we can draw lessons and best practices, even for medium-sized projects.
π Debugging Crashes and Deadlocks in Python using PyStack (martinheinz.dev)
A debugging tool to add to your toolbox, for Linux only.
βοΈ Cython Changelog (cython.readthedocs.io)
The venerable Cython officially releases version 3.0.0 after 3 years of development, featuring many improvements and compatibility with the latest Python versions.
π BONUS: Status of Python Versions (devguide.python.org)