- cross-posted to:
- bumba@boomer.casino
- python@programming.dev
- cross-posted to:
- bumba@boomer.casino
- python@programming.dev
You must log in or # to comment.
a = a ^ b b = a ^ b a = a ^ b
So you are asking the user to do it
Version 3 is disgusting.
That’s like the canonical “swap two pointers” trick
Storing the value in the user instead of RAM!
Using an organic processor
I raise you
@lambda _: _() def result() -> int: global a; global b; a, b = b, a
hat tip to @sisyphean@programming.dev via Cursed Python