this post was submitted on 15 Aug 2025
24 points (96.2% liked)

Programmer Humor

25730 readers
1229 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

Does anyone remember an old blog post where someone used various Python language hacks to override boolean primitives, such that the statement false == true evaluated as true? I'm 90% sure it was python, but maybe it was some other language.

I've been looking for that post recently, but haven't had any luck.

Thanks to antagonistic for finding it! I guess it was less of an "exploit", and more of a "please don't touch the loaded foot-gun"

you are viewing a single comment's thread
view the rest of the comments
[–] solrize@lemmy.ml 8 points 1 day ago* (last edited 1 day ago) (5 children)

The builtin names are True and False and they became keywords a while back. true and false are just ordinary variables that you can set to whatever you want.

Meanwhile, in Forth:

: 2 3 ; \ define 2 as 3
2 2 + .  6 ok   \ shows that 2+2 is now 6
[–] undefined@lemmy.hogru.ch 1 points 1 day ago (4 children)

God I hated that about Python. Why tf we capitalizing True and False?

[–] solrize@lemmy.ml 2 points 1 day ago

They are constants, like None, which has always been around.

load more comments (3 replies)
load more comments (3 replies)