Comment

Comment by nauticacom

I really, genuinely don't get the appeal. I don't follow the "less code = better" ideology so maybe that's a contributor but I really don't see how this:

    class Person:
        def __init__(self, name, age):
            self.name = name
            self.age = age
is any worse than this:

    @dataclass
    class Person:
        name: str
        age: int
I'm not writing an eq method or a repr method in most cases, so it just doesn't add much for the cost.
parent nauticacom 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton