Submission timeline
2007–2026One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.
First comments on top threads
HN comment orderI have a mildly surprising snippet which I believe they don't have. It's about interaction of class and instance attributes with behavior of "X += Y". Python expands it to "X = X + Y" but only if X implements "+" but not "+=" class A: a = (1,) # tuples are immutable and don't have "+=" b = [1,] # lists have "+=" obj = A() obj.a += (2,) # this creates obj.a obj.b += (2,) # this modifies…
I feel like WTFs caused by doing something deeply weird hardly counts against the language. Yes doing the walrus operator inside brackets works. Yes of course it's going to be doing weird things. Is this really surprising to anyone? It's not what that operator is for. Yes comparing strings with "is" works sometimes. It's not checking equality and it isn't supposed to. In another implementation using "is" might work all the time or none of the time. Don't use "is"…
Auch. Quite a few of these stem from the design mistake to allow cross-type equality tests combined with a hard headed effort to try to make it work. >>> 2 == 2L True >>> hex(2) == hex(2L) False >>> type(2) <type 'int'> >>> type(2L) <type 'long'> >>>
There are some good ones in there! I especially like that explanations are given and the optimizations that CPython makes are revealed.
The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.
- Breakout years
- 3
- Total points
- 1132
- Total comments
- 396
100+ points or 50+ comments
reference only — not used in Hall rules or ranking
reference only — not used in Hall rules or ranking
