Rodrigo Girão Serrão 🐍🚀
banner
mathspp.com
Rodrigo Girão Serrão 🐍🚀
@mathspp.com
I'll help you take your Python skills to the next level!

Python deep dive every Monday 🐍🚀 -> https://mathspp.com/insider

Short daily drop of Python knowledge 🐍💧 -> https://mathspp.com/drops
FINALLY had technical issues while delivering a remote talk.

Today I got all of it!

First, my computer froze and I couldn't even share my screen.

Then, at some point my internet connection went POOF and I dropped off the call... 🤦

Hopefully now I'm good again for a dozen more talks.
February 12, 2026 at 7:35 PM
Catch you there?
February 12, 2026 at 10:49 AM
Reposted by Rodrigo Girão Serrão 🐍🚀
Stoked to share that the Steering Council has accepted PEP 814. frozendict is coming to Python 3.15!

discuss.python.org/t/pep-814-ad...
PEP 814: Add frozendict built-in type
After careful deliberation, the Python Steering Council is pleased to accept PEP 814 – Add frozendict built-in type. The absence of an immutable dict counterpart has been a long-standing gap in Pytho...
discuss.python.org
February 11, 2026 at 5:13 PM
Reposted by Rodrigo Girão Serrão 🐍🚀
Introducing the PSF Community Partner Program! The PSF is very excited to announce this new in-kind offering that expands how we support Python community events and initiatives around the world, now and alongside future community support programs 💝🐍
Introducing the PSF Community Partner Program
The Python Software Foundation (PSF) is excited to announce the introduction of the PSF Community Partner Program. This new program is designed as an “in-kind” way for us to support Python events and initiatives with non-financial assistance through the use of the PSF logo and name, as well as promotional support via sharing qualified posts on PSF official social media accounts. The PSF looks forward to supporting Python community events and initiatives through this new program!The introduction of the PSF Community Partner Program grew out of our desire to find alternative ways to support the community during the pause of our Grants Program (read more about the resulting process below). Even so, we intend to continue offering this in-kind support program after the Grants Program reopens. Our big picture hope is that, over the long term, some community events and initiatives will continue to partner with the PSF while being financially dependent on sponsors and individual donors alone. The PSF is also working on the future of our Grants Program, including when and how we can reopen it in a way that ensures the program’s long-term sustainability while balancing the needs of the Python community. In light of the truly staggering outpouring of support from our community during the 2025 year-end fundraiser, we are now in a stronger position to reopen the Grants Program and are eager to give back in a thoughtful and sustainable way. More updates to come!As with the rollout of any new program, we anticipate small adjustments will need to be made for processes to flow smoothly and to ensure the program serves the Python community well. The PSF welcomes your comments, feedback, and suggestions regarding the new Community Partner Program on the corresponding Discuss thread. We also invite you to join our upcoming PSF Board or Grants Program Office Hour sessions to talk with the PSF Board and Staff synchronously. If you wish to send your feedback privately, please email grants@python.org. 
pyfound.blogspot.com
February 10, 2026 at 2:13 PM
This list is missing the soft keywords.

How many are there, and what are they?
Here's a list of the #Python keywords

It's nice that the number is so small that you can actually probably remember all of them fairly easily.
February 9, 2026 at 5:30 PM
I've written this Python function so many times I should no longer be confused by it...

But I never know if it's

def clamp(v):
return min(max(v, low), high)

or

def clamp(v):
return min(max(v, high), low)

Always need to stop and think about it for a minute.
February 9, 2026 at 4:48 PM
If they had used the built-in `range` this wouldn’t happen.
February 3, 2026 at 12:13 PM
It's pretty cool how much you can get done in Python with so little code if you leverage the standard library.
February 2, 2026 at 5:54 PM
One of my students today made this mistake.

If you have a project and want to test it, your tests will import your project.

So, you need to install pytest as a dependency INSIDE your project.

If you install it globally, when you run it, it can't see your own project.
January 30, 2026 at 9:28 PM
Dump JSON and make it Human-readable.
January 30, 2026 at 4:40 PM
Parse JSON from a string with a single function call.

Don't use this if you have JSON in a file. Use `load` for that.

This is for when the data comes in a payload, for example.
January 29, 2026 at 4:19 PM
When writing CLIs and scripts for the terminal, use `sys.exit` to set the exit code of your program.

✅ An exit code of 0 means success; your program terminated without any issues.

❌ Any other integer exit code means “error”.
January 28, 2026 at 4:32 PM
Reposted by Rodrigo Girão Serrão 🐍🚀
“Nothing beats the smiles and thank you’s you get when the conference is over. Plus, it is an amazing feeling to be part of something bigger than yourself.”

Check out the interview with @mathspp.com, Programme Team for EuroPython 2025 blog.europython.eu/humans-of-ep...

#europython #conference
January 27, 2026 at 9:02 AM
Day 2 of my intermediate Python course:

I didn't forget to start the recording.

That's a great start to the day :D
January 27, 2026 at 3:43 PM
Before being added in Python 3.10, itertools.pairwise was commonly implemented in terms of itertools.tee.

Isn't this elegant?
January 27, 2026 at 2:44 PM
`typing.reveal_type` explained:

Runtime vs static type checking time.
January 26, 2026 at 2:12 PM
Python typing pop quiz.

Take a look at the function `choice` shown below.

Note how it's being called as `choice(3, "hey!")`.

Will this type check or not?

If it does, what's the revealed type?

The right answer might surprise you!
It surprised me. 🤷
January 25, 2026 at 2:40 PM
This is how you learn to write really good code.

In Python, and in any other programming language 👇
January 24, 2026 at 3:26 PM
Has anyone here, in the data science world, successfully moved from using conda/miniconda/... to using uv?
January 23, 2026 at 10:09 PM
Python has a flexible mechanism built into `pathlib` to look for files with filenames that follow a given pattern.

You can use `[...-...]` to represent character ranges and `*` to match arbitrary text.

But note that `glob` does NOT support regex syntax!
This is just similar.
January 23, 2026 at 3:28 PM
These two typing features look similar...

But they're very different.

Here's how to use NewType and TypeAlias in Python 👇
January 21, 2026 at 4:27 PM
Pandas 3.0.0 is out now!
January 21, 2026 at 4:24 PM
In hindsight, if you're seeing this on your phone, the QR code isn't very helpful...

Just go to mathspp . com / drops 🤣
Just finished scheduling 3 tips for today, tomorrow and Friday.

If you want to get smarter about Python in just 3 min/day, follow the QR code to sign-up.
January 21, 2026 at 1:11 PM
Just finished scheduling 3 tips for today, tomorrow and Friday.

If you want to get smarter about Python in just 3 min/day, follow the QR code to sign-up.
January 21, 2026 at 9:52 AM
Convert data to a JSON string without writing to a file:

Just use `json.dumps`!

(The final S stands for String!)

```py
import json

data = {"k1": True, "k2": [73, 42, 10]}

s = json.dumps(data)
print(type(s), s)
# <class 'str'> {"k1": true, "k2": [73, 42, 10]}
```
January 20, 2026 at 2:31 PM