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

> For example, complaining that a dictionary key must be place in quotes. It’s not that “the key needs quotes”, but that you’re using “a string” as a key. In fact in Python, you can use any immutable object as a key (tuples, for example). They clearly come from Javascript, Python works differently (and arguably better), and they’re complaining that it doesn’t work the way they’d like it to work.

Agreed. However, there's a trick to use strings without quotes:

    dict(foo=1, bar=2) == {'foo': 1, 'bar': 2}



how is that a trick? you still can't access without quotes? the real trick is a Dict class that in the __init__ sets self.__dict__. but why would you do that just to save trying quotes




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

Search: