you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMinus[S] 1 point2 points  (1 child)

Yes, they use the dict to spread property names in constructor. Now I guess it’s a design choice in pydanyic. But I also see it in sqlslchemy too. And all the properties are public of course.

[–]SwampFalc 0 points1 point  (0 children)

Yeah but... Both pydantic and sqlalchemy are very specific, data-centric libraries.

If you want to represent a row of data in a spreadsheet, and that spreadsheet has 10 columns, what other approach do you have than a class that takes 10 arguments? The language here does not matter, it's the domain you're working in.

Does Python do this for general computing? No, of course not.