Python functions summarised in sentence: “Functions either return something or they blow up” — A student of mine
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
Your frontier of competence is expanded by LLMs based on your current knowledge.
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 🙏
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
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!
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
I forgot a semicolon and my site was down for ~4 hours without me even knowing. The joys of programming. 😂
What's your favourite vanilla Python feature? (Abuses of the Python syntax are valid answers.)
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
Python decorators blueprint: a step by step explanation of the full decorator anatomy. Steal this for when you're writing your own decorators.
I wrote 0 blog posts in February. Today I already wrote 2. Go figure. 🤷
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?
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! 💎
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
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.
`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.
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.
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
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
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.
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.
If they had used the built-in `range` this wouldn’t happen.
It's pretty cool how much you can get done in Python with so little code if you leverage the standard library.
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.
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.