Rodrigo Girão Serrão 🐍🚀

Rodrigo Girão Serrão 🐍🚀

@mathspp.com

I'll help you take your Python skills to the next level! 15 days of Python 3.15 email series -> https://mathspp.com/python-315 Python deep dive every Monday 🐍🚀 -> https://mathspp.com/insider

1.1K followers313 following1.3K posts

Pinned

Python 3.15.0 was just released! To celebrate, I'm doing 15 days of Python 3.15. Each week day, I'll write about a new Python 3.15 feature. We'll cover lazy imports, the new built-ins, the DX improvements, some new stdlib niceties, and MUCH more. I'll collect my posts here 👇

Rodrigo Girão Serrão 🐍🚀 reposted

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 3.15.0 was just released! To celebrate, I'm doing 15 days of Python 3.15. Each week day, I'll write about a new Python 3.15 feature. We'll cover lazy imports, the new built-ins, the DX improvements, some new stdlib niceties, and MUCH more. I'll collect my posts here 👇

View full thread

What do you do when you can't use `None` as the default? You can use `object()`... Or a singleton class... Or another workaround... And all these hacks had flaws. That's why Python 3.15 introduced the built-in `sentinel`. You can use it to create placeholder values 👇

There are many benefits to using `sentinel`. One of them is that typing sentinels is much cleaner than typing any of the alternatives. That's because sentinels can be used as their own type. Just like `None` can 👇

Python startup times just got faster. In 3.15, you can use the keyword `lazy` to make a lazy import (`math` and `Path` below). Lazily imported modules are only loaded WHEN they're used, and IF they're used. Use them to defer loading of modules that may not be required.

What's the consensus on `sentinel` vs `None`? Assume no backwards compatibility concerns. Do you still use `None` for pretty much all “nothing” usages and use `sentinel` only when `None` doesn't cut it? Or are you going to default to `sentinel` for placeholders?

Who had this ridiculous idea of doing 15 blog articles about Python 3.15 in 15 days while also running 5 workshops in 10 days? My weekly Monday newsletter is delayed and will only be coming out tomorrow 🤞

Python 3.15.0 was just released! To celebrate, I'm doing 15 days of Python 3.15. Each week day, I'll write about a new Python 3.15 feature. We'll cover lazy imports, the new built-ins, the DX improvements, some new stdlib niceties, and MUCH more. I'll collect my posts here 👇

🏆 Top 5 Python 3.15 features to start using today: 1. Lazy imports 2. New built-in `frozendict` 3. New built-in `sentinel` 4. Unpacking inside comprehensions 5. New sampling profiler Tachyon What's your top Python 3.15 new feature?

It's happening! And to celebrate (?) I'm spending the next 15 days writing about Python 3.15 In a couple of hours I'll be sharing what I think are some of the most exciting new features of 3.15. See you in a bit!

Rodrigo Girão Serrão 🐍🚀 reposted

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...

ngrok.comQuantization from the ground up | ngrok blogA complete guide to what quantization is, how it works, and how it's used to compress large language models

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?

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?

Rodrigo Girão Serrão 🐍🚀 reposted

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! 💎

Rodrigo Girão Serrão 🐍🚀 reposted

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.

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.

Catch you there?

Veit Schiele@veit-schiele.de

Final preparations for the Python Users Berlin (@python.berlin) meeting tonight. I’m looking forward to meeting all the Pythonistas in Berlin and Rodrigo’s (@mathspp.com) talk on itertools.tee: www.meetup.com/python-users... #Python #Berlin

Rodrigo Girão Serrão 🐍🚀 reposted

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 💝🐍

pyfound.blogspot.comIntroducing the PSF Community Partner ProgramThe 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.