Rodrigo 🐍🚀 (@mathsppblog) header
Rodrigo 🐍🚀 (@mathsppblog) profile picture

15 days of Python 3.15 👉 https://nitter.cf/t.co/MOgbHhCiMi

🐍🚀 Free uv cheatsheet 👉
Joined July 2020
Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)Photo by Rodrigo 🐍🚀 (@mathsppblog)
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 👇
1
4
17
1,508
How to write a thread-safe generator in 3.15.
5
940
Load JSON data as an immutable object in Python 3.15.
1
11
855
I can't remember Python before this. Before Python underlined the part of the line that raised the error. Who remembers what Python version this was added on?
1
1
1,140
Python is getting quite colourful!
5
1,315
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.
1
242
New built-in `sentinel` nitter.cf/mathsppblog/status/211…
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 👇
1
1
133
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 👇
1
1
6
1,078
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 👇
1
1
1
235
What's an example usage of a module-level `__getattr__` you've come across?
1
1,598
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.
1
1
8
1,301
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/explicit-la…
1
228
I'm doing 15 days of Python 3.15. Follow @mathsppblog for the whole journey. Check my profile for the free email series.
184
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?
2
1
1,321
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 🤞
2
7
1,408
Rodrigo 🐍🚀 retweeted
1
9
1
84
3,580
The syntax highlighter on my website isn't keeping up with Python 😮‍💨
1
6
1,133
uv self update; uvx whatsnewt
1
6
1,243
uv 0.13.0 is out now and it uses Python 3.15 as the default stable version! Time to go update my uv cheatsheet to note that it's compatible with uv 0.13.0 Given the recent wave of supply chain attacks, should I include --exclude-newer in the cheatsheet?
2
8
1,332
Who else is compulsively running `uv self update` to get 3.15.0 through uv?
3
13
2,430