Hacker News new | past | comments | ask | show | jobs | submit login

I don't think this will refute the article, but I would have found it more convincing if the benchmark had included a single setitem assignment as well, to be sure that the difference wasn't python doing a lazy dict-or-set type assignment on {}



I've also had this thought, but found that inspecting the type shows its by default a dictionary, and that it only is interpreted as a set if you treat it as such (eg add comma-seperated elements when instantiating)

assert type({}) == type(dict())) assert type({1,2,3} == type(set())




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

Search: