News for hackers. Stuff that matters.
Re:Proposing a Struct Syntax for Python by taeric on Wednesday June 14, 2023 @01:58PM (#36329864)
I was surprised at how dataclasses are not the first thing people are taught when it comes to "classes" in python. My two personal "you should probably learn how these work" things for beginners are pprint and dataclass. Goes a long long way to helping look at things.
Re:Proposing a Struct Syntax for Python by jasonpeacock on Wednesday June 14, 2023 @02:18PM (#36330185)
It's because the traditional teaching focus is OOP and not data-driven design.
Re:Proposing a Struct Syntax for Python by taeric on Wednesday June 14, 2023 @03:21PM (#36331166)
The part that blows my mind, on this, is that I see it in the "data science" community. An area that seems custom made for leaning on smaller or non-existent inheritance trees.
Re:Proposing a Struct Syntax for Python by xapata on Wednesday June 14, 2023 @03:04PM (#36330928)
Dataclasses wind up cumbersome over time. They're nice when the defaults are what you want. After a handful of default overrides, I'd rather have not used dataclasses.
Re:Proposing a Struct Syntax for Python by taeric on Wednesday June 14, 2023 @03:20PM (#36331151)
In the office job, I'd push on why the defaults didn't work out. In particular, I would be worried that I was specifically aiming to make future life a bit harder by not fitting with the defaults of dataclass.

To that end, I'm curious what defaults you didn't use?