3 ms·
It's mundane because there's nothing special about it. Everyone knows python has dictionaries. Everyone knows python has functional features. Everyone knows you
by hasenj 12y ago
It's mundane because there's nothing special about it. Everyone knows python has dictionaries. Everyone knows python has functional features. Everyone knows you can attach functions as properties of objects.
There's really nothing new or interesting about it. Except maybe for beginners. Which is fine. Nothing wrong with being a beginner. It's just not what I expect to see on the frontpage of HackerNews.
That's almost like someone saying: look wow, 2+2 and 2*2 and 2^2 all return the same result! Sure, amusing when you realize it for the first time, but hardly interesting for anyone but a first grader.
- eatonphil 12y agoWhen have you seen this pattern shown in a Python beginners tutorial? ... or anywhere? I have never seen this pattern before and for that reason it is interesting.
- hasenj 12y agoWhy would it show in beginner tutorials? It's just not pythonic. > There should be one-- and preferably only one --obvious way to do it. Not to mention that the object['field'] syntax is rather annoying.