35
submitted 3 months ago* (last edited 3 months ago) by CrackedLinuxISO@lemmy.dbzer0.com to c/programmer_humor@programming.dev

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
[-] undefined@lemmy.hogru.ch 3 points 3 months ago

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

[-] lime@feddit.nu 4 points 3 months ago

all builtin constants are capitalised.

[-] RecallMadness@lemmy.nz 4 points 3 months ago* (last edited 3 months ago)

All… five of them!

The other 7 are all lowercase. (One of you ignore site)

[-] lime@feddit.nu 2 points 3 months ago

yeah but dunders usually aren't included in counts

[-] squaresinger@lemmy.world 1 points 3 months ago

And they also don't follow the conventions for constants otherwise, which are all caps.

[-] lime@feddit.nu 1 points 3 months ago

i think we're talking about different things.

[-] solrize@lemmy.ml 2 points 3 months ago

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

this post was submitted on 15 Aug 2025
35 points (97.3% liked)

Programmer Humor

27720 readers
136 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