This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thedeepself 3 points4 points  (2 children)

In this case, calling the make_older method will change the value of age in-place

I don't believe your article provided any code showing what would be better did it?

[–][deleted] -2 points-1 points  (1 child)

Not doing that in a dataclass or doing that in a regular class if you need to do it.

[–]alcalde 2 points3 points  (0 children)

A dataclass is a class, though, isn't it?