The 90% use case with dataclasses is satisfied with just "@dataclass", and perhaps the target user there is less sophisticated.
But the main difference between @dataclass and @lru_cache is that all of the parameters to @dataclass are keyword-only. Which I did because they are mostly all booleans, and "@dataclass(True, False, True)" isn't very helpful.
That's not the case with @lru_cache. Whether that makes a difference for this issue in particular, I'm not sure.
I agree that this violates "only one way to do it". But I haven't seen anyone use "@dataclass()", and I've also never seen anyone be confused by the fact that once you want parameters, you change to using parens. For the dataclass case, I think that working both ways has been helpful. |