this post was submitted on 12 Jun 2023
70 points (100.0% liked)

Programmer Humor

32464 readers
150 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 5 comments
sorted by: hot top controversial new old
[–] abclop99@beehaw.org 6 points 1 year ago
a = a ^ b
b = a ^ b
a = a ^ b
[–] pewpew@feddit.it 3 points 1 year ago

So you are asking the user to do it

[–] bauklotz@feddit.de 2 points 1 year ago

Version 3 is disgusting.

[–] MyNameIsRichard@lemmy.ml 1 points 1 year ago

Using an organic processor

[–] jnovinger@programming.dev 1 points 1 year ago

I raise you

@lambda _: _()
def result() -> int:
    global a; global b; a, b = b, a

hat tip to @sisyphean@programming.dev via Cursed Python