r/ProgrammerHumor 2d ago

Meme pythonFeelsillegal

Post image
6.7k Upvotes

219 comments sorted by

View all comments

Show parent comments

21

u/carcigenicate 2d ago

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

12

u/SoldRIP 2d ago

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

9

u/Duck_Devs 2d ago edited 2d 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

3

u/Character-Education3 2d 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 2d 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.