Bob and I have spent many years as Python devs, and 6 years coaching with Pybites and we can safely say that being a Senior Developer is only about 1/3 Python knowledge. The other 60% is the ecosystem. It's the tooling. It's all of the tech around Python that makes you stand out from the rest. This is the biggest blind spot keeping developers stuck in Tutorial Hell. You spend hours memorising obscure library features, but you crumble when asked to configure a CI/CD pipeline.
Kacper Borucki blogged about parameterizing exception testing, and linked to pytest docs and a StackOverflow answer with similar approaches. The common way to test exceptions is to use pytest.raises as a context manager, and have separate tests for the cases that succeed and those that fail. Instead, this approach lets you unify them. I tweaked it to this, which I think reads nicely: One parameterized test that covers both good and bad outcomes. Nice.
When it comes to working with data in a tabular form, most people reach for a spreadsheet. That's not a bad choice: Microsoft Excel and similar programs are familiar and loaded with functionality for massaging tables of data. But what if you want more control, precision, and power than Excel alone delivers? In that case, the open source Pandas library for Python might be what you are looking for.
The PSF is pleased to announce its fourth batch of PSF Fellows for 2025 ! Let us welcome the new PSF Fellows for Q4 ! The following people continue to do amazing things for the Python community: Chris Brousseau Dave Forgac Inessa Pawson Karen Dalton Tatiana Andrea Delgadillo Garzofino Thank you for your continued contributions. We have added you to our Fellows Roster .
Using AI to help download photos so we can consolidate all our images into one place. Over the years, [Audrey](https://audrey.feldroy.com) and I have accumulated photos across a variety of services. Flickr, SmugMug, and others all have chunks of our memories sitting on their servers. Some of these services we haven't touched in years, others we pay for but rarely use. It was time to bring everything home.
We speak with course instructor Stephen Gruppetta about building a course where the participants start using their knowledge as soon as possible. He describes how he's evolved his teaching techniques over years of working with beginners. We explore the advantages of having a curated collection of written tutorials, video courses, and a forum for asking those nagging questions. We also speak with students Louis and Andrew about their experiences learning
Structural pattern matching excels at... matching the structure of your objects! For the two examples in this article, we'll be using a number of dataclasses that you can use to build abstract Boolean expressions: from dataclasses import dataclass class Expr: pass @dataclass class And(Expr): exprs: list[Expr] @dataclass class Or(Expr): exprs: list[Expr] @dataclass class Not(Expr): expr: Expr @dataclass class Var(Expr): name: str
If you want to learn Python or improve your skills, a detailed plan can help you gauge your current status and navigate toward a target goal. This tutorial will help you craft a personal Python learning roadmap so you can track your progress and stay accountable to your goals and timeline: The steps in this tutorial are useful for Python developers and learners of all experience levels. While you may
If you're using print calls to debug your Python code, consider using f-strings with self-documenting expressions instead. A broken Python program Here we have a program that makes a random math prompt and then validates whether the answer give by the user is correct: This program doesn't work right now: $ python3 check_mult.py What's 9 multiplied by 8? 72 That's incorrect Our program always tells us that our answer is incorrect.
And there's another thing I can never remember, especially at this time of year when large-ish gatherings are more common. How many people are needed in a group to have a probability greater than 50% that two people share a birthday? This could be an ice-breaker in some awkward gatherings, but only if you're with a geeky crowd. Although the analytical proof is cool, writing Python code to explore this problem is just as fun. Here's my article from February exploring the Birthday Paradox:
sys._jit.is_available(): Lets you know if the current build of Python has the JIT. Most binary builds of Python shipped will now have the JIT available, except the "free-threaded" or "no-GIL" builds of Python. sys._jit.is_enabled(): Lets you know if the JIT is currently enabled. It does not tell you if running code is currently being JITted, however.
In this quiz, you'll test your understanding of the LlamaIndex in Python: A RAG Guide With Examples tutorial. By working through this quiz, you'll revisit how to create and persist an index to disk, review how to reload it, and see why persistence improves performance, lowers costs, saves time, and keeps results consistent.
The commoditization of Optical Character Recognition (OCR) has historically been a race to the bottom on price, often at the expense of structural fidelity. However, the release of Mistral OCR 3 signals a distinct shift in the market. By claiming state-of-the-art accuracy on complex tables and handwriting-while undercutting AWS Textract and Google Document AI by significant margins-Mistral is positioning its proprietary model not just as a cheaper alternative, but as a technically superior parsing engine for RAG (Retrieval-Augmented Generation) pipelines.
I couldn't get Hypothesis to generate usable data for my test. I wanted to assert that two equal data items would hash equally, but Hypothesis was finding pairs like[0] and [False]. These are equal but hash differently because the hash takes the types into account.
Have you ever thought about getting your small product into production, but are worried about the cost of the big cloud providers? Or maybe you think your current cloud service is over-architected and costing you too much? Well, in this episode, we interview Michael Kennedy, author of "Talk Python in Production," a new book that guides you through deploying web apps at scale with right-sized engineering.
I know, from personal experience, that it takes a significant amount of effort to research, write, revise, and submit a decently plausible funding proposal to the US government's National Science Foundation. A successful NSF proposal is as tightly structured as a sonnet, even beyond the explicit requirements given in the solicitation; every diagram or chart, every paragraph, every sentence of those 20-30 pages has to hit a particular mark.
Web development roles often emphasize frameworks like Flask, Django, and, more recently, FastAPI, along with database knowledge and REST API design. Employers often seek full-stack engineers who feel comfortable working on the backend as well as frontend, including JavaScript, HTML, and CSS. Data science positions highlight libraries like NumPy, pandas, Polars, and Matplotlib, plus an understanding of statistical concepts. Machine learning jobs typically add PyTorch or TensorFlow to the mix. Test automation roles likely require familiarity with frameworks such as Selenium, Playwright, or Scrapy.
Your code is easiest to read just after you've written it. Your future self will find your code far less readable days, weeks, or months after you've written it. When it comes to code readability, whitespace is your friend. Whitespace around operators Compare this: To this: I find that second one more readable because the operations we're performing are more obvious (as is the order of operations). Too much whitespace can hurt readability though: This seems like a step backward because we've lost those three groups we had before. With both typography and visual design, more whitespace isn't always better.
I am pleased to announce that scikit-survival 0.26.0 has been released. This is a maintainance release that adds support for Python 3.14 and includes updates to make scikit-survival compatible with new versions of pandas and osqp. It adds support for the pandas string dtype, and copy-on-write, which is going to become the default with pandas 3. In addition,sksurv.preprocessing.OneHotEncoder now supports converting columns with the object dtype.
Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: Deprecations via warnings Michael #2: docs
Narwhals is intended for Python library developers who need to analyze DataFrames in a range of standard formats, including Polars, pandas, DuckDB, and others. It does this by providing a compatibility layer of code that handles any differences between the various formats. In this tutorial, you'll learn how to use the same Narwhals code to analyze data produced by the latest versions of two very common data libraries. You'll also discover how Narwhals utilizes the efficiencies of your source data's underlying library when analyzing your data.
You provide three tiers to your customers: Gold, Silver, and Bronze. And one of the perks of the higher tiers is priority over the others when your customers need you. Gold customers get served first. When no Gold customers are waiting, you serve Silver customers. Bronze customers get served when there's no one in the upper tiers waiting. How do you set up this queue in your Python program?