177
Don't do it (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] Ziglin@lemmy.world 1 points 1 year ago

I understand that, it makes sense. But why does it not throw an error? The parameter is missing after all.

[-] takeda@lemm.ee 2 points 1 year ago

Actually the explanation is wrong.

not()

is actually

not ()

not is a keyword not a function.

Boolean of empty tuple is False and then not negates it.

I explained it better here:

https://lemm.ee/post/61594443/19783421

[-] Ziglin@lemmy.world 1 points 1 year ago

That makes a lot more sense, thanks I did see in the syntax highlighting that it was a keyword but forgot that none of them took parameters.

[-] spooky2092@lemmy.blahaj.zone 0 points 1 year ago

No it's not, "" (a null/empty string) is the parameter. Not every function needs a parameter to be valid, and negation is one of them. Negating nothing is something, so "not()" = "not(null)" = "not(false)" = "true"

this post was submitted on 17 Apr 2025
177 points (92.8% liked)

memes

21325 readers
3459 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/Ads/AI SlopNo advertisements or spam. This is an instance rule and the only way to live. We also consider AI slop to be spam in this community and is subject to removal.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 2 years ago
MODERATORS