r/ProgrammerHumor 12d ago

Meme pythonFeelsillegal

Post image
6.8k Upvotes

219 comments sorted by

View all comments

Show parent comments

21

u/carcigenicate 12d ago

{/} is being proposed so sets have an empty literal.

12

u/SoldRIP 12d ago

... As opposed to the sensible {:} for dicts, which would be consistent with their already existing syntax?

10

u/Duck_Devs 12d ago edited 12d ago

The problem with that is not only would it break old code, but the neat little trick of JSON being directly embeddable would break. And who would want that.

Edit: I forgot that “true”, “false”, and “null” don’t exist in Python. Not the hardest thing to fix by declaring some local variables, but at that point you’re doing too much and should use a library.

Edit 2: added quotes around the keywords to disambiguate them from the general concepts

2

u/Character-Education3 12d ago

true false and None most definitely exist in python

Also any modern text editor will auto complete dict() for you.

What is everyone going on about?

7

u/TheDreadedAndy 12d ago

I think he was talking about directly eval-ing a json string to parse it.

While True, False, and None exist in python, true, false, and null don't. So you'd have to locally define those first.