Pinned
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
Rodrigo Girão Serrão 🐍🚀 reposted
Explicit lazy imports bsky.app/profile/math...
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.
New built-in `sentinel` bsky.app/profile/did:...
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 👇
If you want to learn more about how to create and use placeholder values in 3.15, read the article below: mathspp.com/blog/pydonts...
If you want to learn more about explicit lazy imports. See use case scenarios. Learn how to make them backwards compatible. Etc. Read this blog post: mathspp.com/blog/explici...
I'm doing 15 days of Python 3.15. Follow @mathspp.com for the whole journey. And check my profile for the free email series.
Btw, how cool is this logo by @riecatnor.bsky.social and @georgically.bsky.social? Each day, I'll write about a new feature of 3.15. I'll post a highlight here and I'll write a full blog post at mathspp.com/blog You can also receive the highlights directly in your email 👉 mathspp.com/python-315
Top 5 Python 3.15 new features: bsky.app/profile/math...
🏆 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?
To learn more about each of these features, you can see examples and explanations here: mathspp.com/blog/the-5-m...
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!
Python 3.15.0 release day thread over on Mastodon: mastodon.social/@hugovk/1174... #Python #Python315 #release
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...
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 🙏
Rodrigo Girão Serrão 🐍🚀 reposted
These uv Python skills for coding agents look promising. From @mathspp.com mathspp.com/blog/uv-skills
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...
Astral just entered into an agreement with OpenAI to integrate their Codex team! openai.com/index/openai...
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?
Rodrigo Girão Serrão 🐍🚀 reposted
Rodrigo Girão Serrão 🐍🚀 reposted
Rodrigo Girão Serrão 🐍🚀 reposted
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...
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 💝🐍