Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn’t some logic necessary to determine if you’re dealing with a dictionary or set? Or dictionary/set comprehension?

You could probably override it using Python’s extension system.

Forgive me, I know Python very well, but not C/C++. I’ve learned to make no assumptions.



Check out the Python bytecode in the article, and remember that bytecode is only generated once from the text of the program (but executed many times). "{}" is translated into a simple "make a dict" instruction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: