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

My problem with {} is that the syntax for dicts {x1:y1, x2:y2 ...} and sets {x1, x2 ...} Are very close, and {} is slightly ambiguous.

I've run into bugs because i wrote {} for the empty set. Since then i write dict() and set()



+1. I've run into this too, and ended up using set() to clarify.


You could write, e.g., `flags: set = {}` to get both speed and readability.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: