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
Why does OOP exist? Why does it work the way it does? What's up with the magic in `self`?

If you're new-ish to OOP I expect this article to fundamentally change the way you understand OOP.

(For the better!)

If it doesn't, I failed.

You can read it here 👉 mathspp.com/blog/why-oop...
Why OOP exists
Learn the fundamental principles behind OOP and how they connect to the syntax of Python.
mathspp.com
August 27, 2026 at 5:30 PM
Python functions summarised in sentence:

“Functions either return something or they blow up”

— A student of mine
May 26, 2026 at 3:10 PM
Your frontier of competence is expanded by LLMs based on your current knowledge.
April 24, 2026 at 1:54 PM
I'm trying to reach out to Charlie Marsh @crmarsh.com because of the upcoming EuroPython conference.

Do I know anyone here who can help me get to him?

Thanks 🙏
April 20, 2026 at 3:13 PM
Reposted by Rodrigo Girão Serrão 🐍🚀
These uv Python skills for coding agents look promising. From @mathspp.com
mathspp.com/blog/uv-skills
uv skills for coding agents
This article shares two skills you can add to your coding agents so they use uv workflows.
mathspp.com
April 9, 2026 at 3:50 PM
If you’re at PyCon Lithuania 🇱🇹 #PyConLT, join me to learn about the paradox of itertools.tee in the Diamond room at 11am.

See you there!
April 8, 2026 at 5:10 AM
Reposted by Rodrigo Girão Serrão 🐍🚀
I spent 2 months learning about quantization and am extremely proud of the post I've written about it. I think these are some of the nicest visuals I've ever made, and I love how this compression technique invented in 1898 is being used on the bleeding edge in 2026.

ngrok.com/blog/quantiz...
Quantization from the ground up | ngrok blog
A complete guide to what quantization is, how it works, and how it's used to compress large language models
ngrok.com
March 25, 2026 at 4:32 PM
I forgot a semicolon and my site was down for ~4 hours without me even knowing.

The joys of programming. 😂
March 23, 2026 at 7:30 PM
What's your favourite vanilla Python feature?

(Abuses of the Python syntax are valid answers.)
March 23, 2026 at 1:50 PM
Astral just entered into an agreement with OpenAI to integrate their Codex team!

openai.com/index/openai...
OpenAI to acquire Astral
Accelerates Codex growth to power the next generation of Python developer tools
openai.com
March 19, 2026 at 2:39 PM
Too many arrows?
March 17, 2026 at 2:23 PM
Python decorators blueprint: a step by step explanation of the full decorator anatomy.

Steal this for when you're writing your own decorators.
March 12, 2026 at 5:23 PM
I wrote 0 blog posts in February.

Today I already wrote 2.

Go figure. 🤷
March 2, 2026 at 3:22 PM
Came up with 4 random ways to do this.

2, I recommend you use them (although 1 doesn't work!)

The other 2 are really cool — they use fixed points and `itertools.groupby` — but they'll be overkill 99.9% of times.
How do you collapse runs of adjacent spaces in Python?

That is, shorter runs of 2+ consecutive spaces so there's only 1 space there?

I can't come up with a simple/straightforward way to do it with `str.join` and I'm surprised...

What am I missing?
March 2, 2026 at 2:40 PM
How do you collapse runs of adjacent spaces in Python?

That is, shorter runs of 2+ consecutive spaces so there's only 1 space there?

I can't come up with a simple/straightforward way to do it with `str.join` and I'm surprised...

What am I missing?
March 2, 2026 at 1:24 PM
Reposted by Rodrigo Girão Serrão 🐍🚀
Hey all! It's almost time for the next Python Lisbon Meetup! 🐍

On Thursday, pyctrl will be talking about exceptions. We'll cover the origin of exceptions, their usage in OOP, how best to manage them, and more. It's going to be exceptional! 💎
February 27, 2026 at 12:46 PM
How do you read `*args` in a function signature?

PLEASE reply with how you'd read it, I'm trying to prove someone wrong 🤣

Reposts are appreciated :D
February 23, 2026 at 1:25 PM
Reposted by Rodrigo Girão Serrão 🐍🚀
What do LLMs see?

I wrote a lil' tool that extracts the attention matrices out of open models and creates this typing visual, with each token's opacity changing according to its average attention score as the prompt progresses. Dimmer words are considered less important to the model.
February 19, 2026 at 12:14 PM
`itertools.compress` explained in a simple diagram.

Useful when you need to filter an iterable of data based on a second iterable of flags or selectors.
February 19, 2026 at 11:56 AM
How does this slide look?
February 18, 2026 at 2:07 PM
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 [email protected]
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