Tag

variable swap

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Jun 8, 2025 · Fundamentals

Why Python’s a, b = b, a Isn’t Magic – The Real Mechanics Explained

This article demystifies Python’s a, b = b, a idiom by detailing how tuple packing and unpacking work, the exact evaluation order, the CPython bytecode implementation, comparisons with C, C++, Java, JavaScript, and the performance and memory implications of the technique.

BytecodePythonperformance
0 likes · 17 min read
Why Python’s a, b = b, a Isn’t Magic – The Real Mechanics Explained
Python Programming Learning Circle
Python Programming Learning Circle
Aug 6, 2024 · Fundamentals

Four Time‑Saving Python Tricks to Boost Execution Speed

This article presents four practical Python performance tricks—including list reversal with slicing versus reverse(), one‑line variable swapping, moving loops inside functions, and reducing function calls—each demonstrated with code examples and timing results that show measurable speed improvements.

Pythonlist reversalloop optimization
0 likes · 5 min read
Four Time‑Saving Python Tricks to Boost Execution Speed