PythonHub
2.31K subscribers
2.35K photos
48.9K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
How local variables work in Python bytecode

The post explains how local variables are managed in Python bytecode: they’re stored in reserved slots at the bottom of each function’s stack frame, with the stack holding references to objects on the heap. By walking through a custom Python interpreter in Rust, the author illustrates how compiled bytecode uses indices (not names) to access these slots, demystifying the stack-based stora...

https://fromscratchcode.com/blog/how-local-variables-work-in-python-bytecode/
Surprisingly Fast AI-Generated Kernels We Didn’t Mean to Publish (Yet)

Stanford researchers show that AI-generated CUDA kernels—created without relying on standard libraries—can now match or even outperform expert-optimized PyTorch kernels on specific tasks, thanks to parallel search and synthetic data generation. Their approach demonstrates that combining strong reasoning with broad exploratory search yields rapid performance gains, highlighting a promisin...

https://crfm.stanford.edu/2025/05/28/fast-kernels.html
Should You Replace Every For Loop With Map and Filter?

Think map() and filter() are always better than for loops? Not so fast. This video walks you through four situations where functional code actually makes things worse—and explain why the classic for loop still deserves a place in your toolbox.

https://www.youtube.com/watch?v=ylzo04lU9Xs