Message341255
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. |
|
Date |
User |
Action |
Args |
2019-05-02 08:18:16 | eric.smith | set | recipients:
+ eric.smith, gvanrossum, rhettinger, serhiy.storchaka |
2019-05-02 08:18:16 | eric.smith | set | messageid: <1556785096.79.0.223245511019.issue36772@roundup.psfhosted.org> |
2019-05-02 08:18:16 | eric.smith | link | issue36772 messages |
2019-05-02 08:18:16 | eric.smith | create | |
|