r/ProgrammerHumor 2d ago

Meme pythonFeelsillegal

Post image
6.7k Upvotes

219 comments sorted by

View all comments

Show parent comments

450

u/chawmindur 2d ago

And {} (= dict())

7

u/chat-lu 2d ago

You can also use braces for code blocks, as long as you indent properly.

def main() -> None: #{
    do_stuff()
#}

6

u/chawmindur 2d ago

I was about to say something about hashability but then I saw you've got your bases covered and commented out the braces...

... that and how something like a do_stuff() would typically be returning None anyway and hence wouldn't cause issues being placed into a set.

And one final thing that this reminds me of: this classic

3

u/chat-lu 2d ago

If that is maintained by an auto-formatter and not by hand, I don’t hate it.