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 orderWhile the conciseness of attrs is nice, it's not very readable. This: class Point3D(object): def __init__(self, x, y, z): self.x = x self.y = y self.z = z ...is much easier to read than this: import attr @attr.s class Point3D(object): x = attr.ib() y = attr.ib() z = attr.ib() Readability is what I love about Python. I don't think the conciseness of attrs is worth the loss in readability.
The @dataclass decorator [1] as proposed in PEP 557 [2] has also been available since Python 3.7 was released in 2018. Using @dataclass the example from OP would look like: from dataclasses import dataclass @dataclass class Point3D: x: float y: float z: float [1]: https://docs.python.org/3/library/dataclasses.html [2]: https://www.python.org/dev/peps/pep-0557/
If I'm not mistaken, python 3.7's data classes will make attrs mostly obsolete?
Actually, I consider the immutability of a `namedtuple` instance to be a benefit. I wish more things in Python were/could be immutable. I have been known to subclass `tuple` from time to time when I want both immutability and the ability to define methods. I wince when I see `namedtuple` being subclassed. Most users don't realise that the implementation of it actually builds up a giant string to pass to `eval()`... thoroughly nasty! At least it's hidden underneath the covers…
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
- 2
- Total points
- 428
- Total comments
- 215
100+ points or 50+ comments
reference only — not used in Hall rules or ranking
reference only — not used in Hall rules or ranking
Every submission
| Date | Title as submitted | By | Points | Comments |
|---|---|---|---|---|
| 2016-08-12 | The One Python Library Everyone Needs | ingve | 5 | 0 |
| 2016-08-13 | Attrs – a Python package for class decorators | danso | 4 | 0 |
| 2016-08-13 | The One Python Library Everyone Needs | ashitlerferad | 9 | 0 |
| 2016-08-14 | The One Python Library Everyone Needs | sciurus | 3 | 1 |
| 2016-08-23 | Attrs: the one python library that everyone needs | mmariani | 5 | 0 |
| 2016-08-25 | Using attrs for everything in PythonFirst breakout · Best thread | StavrosK | 246 | 101 |
| 2018-05-26 | Attrs – The python library everyone needs (2016) | lordvigm | 5 | 2 |
| 2021-12-24 | Attrs – the Python library everyone needs (2016)Hall induction · Latest 20+ point return | aqeelat | 151 | 111 |
