Python Tip #283 (of 365):
Delay slow imports until they're needed. ๐งต

@hugovk.dev
Python 3.14 & 3.15 release manager, core developer, Sovereign Tech Fellow, PSF Fellow, open-source maintainer, PEP editor, NaNoGenMo organiser, winter bicycler
My recent work on PyBytesWriter and PyUnicodeWriter C API, bugfixes, optimizations, and documentation changes: vstinner.github.io/optimize-pyb... PyBytesWriter is now 1.28x faster than Python 3.15 and PyUnicodeWriter can avoid memory copies. Detect buffer overflow in debug mode.
Happy Python 3.15 final day!
May you all go forth and profile and lazy import and use frame pointers everywhere!*
*please read the What's New, release too stacked ๐๏ธ
docs.python.org/3.15/whatsne...
Itโs been a while, but Core Dispatch 11 is out!
Happy Python 3.15 final day to all that celebrate! Congrats to @hugovk.dev on getting the release across the finish line! ๐
Catch up on whatโs been happening in CPython:
coredispatch.xyz/editions/11
๐๐ Out now: Python 3.15.0 final!
๐ค Lazy imports!
๐ง frozendict builtin!
๐ sentinel builtin!
๐ Tachyon profiler!
๐ฃ๏ธ UTF-8 by default!
๐ abi3t!
๐จ More colour!
๐ & more!
discuss.python.org/t/python-3-1...
Huge thanks @sovereign.tech for supporting my work as RM!
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:
๐๐ Out now
Security releases
Python 3.10: last ever release!
Python 3.11
Python 3.12
Python 3.13: last bugfix release with installers
Python 3.14
discuss.python.org/t/python-3-1...
And Python 3.15 rc3
Final coming next week!
discuss.python.org/t/python-3-1...
#Python #Python315 #Python314 #release
Time to upgrade your #Python versions! ๐๐ก๏ธ
3.14.8, 3.13.16, 3.12.15, 3.11.17, and 3.10.22 were just published and contain significant security fixes (8 CVEs) including 1 critical and 2 high severity fixes. Thanks to the PSRT and RMs for coordinating.
I just optimized PyFloat_PackN() C functions in Python using __builtin_bswapN() to swap bytes. Problem: GCC does crash and clang miscompiles the 16-bit function which uses _Float16 on IBM s390x! GCC bug report: bugzilla.redhat.com/show_bug.cgi... clang bug report: github.com/llvm/llvm-pr...
๐๐ Out now
pepotron
Open PEPs like `pep 745 790`
github.com/hugovk/pepot...
linktron
Read clipboard if no input
github.com/hugovk/linko...
norwegianblue
Cycle name in EOL colour
github.com/hugovk/norwe...
pylast
Only retry transient net failures
github.com/pylast/pylas...
all: Drop #Python 3.10
Reminder: We're currently hiring for several roles across the team. Join the Sovereign Tech Agency and help shape the digital infrastructure of the 21st century:
#Hiring #OpenSource #PublicInterestTech #DigitalSovereignty
1/
It's a change in how PyPI is counting downloads, they're no longer including the .metadata file counts:
๐๐ฉ frozendict, pytest Plugins, re.prefixmatch(), and More at Pycoders Weekly Issue 753 pycoders.com/issues/753
PSA: Next week Python 3.15 comes out.
This means Python 3.13 will stop receiving bug fixes and end of October this year Python 3.10 will be EOL, Python 3.11 will have one more year until EOL, etc.
One week until Python 3.15.0 final!!
hugovk.dev/next-release/
What are you most looking forward to?
docs.python.org/3.15/whatsne...
The lovely folks from @rust-lang.org pinged me in a mutual security discussion channels about these ongoing attacks:
There's no reason attackers wouldn't do the same to maintainers of Python projects. Report weirdness to [email protected] so we can alert others if needed.
Two weeks until Python 3.15.0 final!
hugovk.dev/next-release/
#Python #python315