Wouldnt the @property decorator be nicer to use? Unless you truly dont want full name to be different when first or last are mutated. But i think a property would be best
It's really bad example unless the dataclass is frozen (read only). Now you can change values of first and last but full will always stay the same as when it was initialized.
I like the jojo ref 😂 👍
Interesting new information, and illustrated in a very clear way, but as a side point, making fields out of other fields is a real bad violation of data theory. Maybe a better example would be storing a file name and then also storing the opened FILE (ie the thing like a file "handle" in C)
What is the difference between this and a normal constructor ?
I'm not sure I'd call it a "trick" since it's very explicitly described in the module documentation.
Thanks a lot!
Full video is also great.💯
Where can we use this?. Why is it needed?
What font are you using in this IDE?
I use pydantic instead
thank you, this is new to me
ye i am so brainless i dont even know what a dataclass is
Very interesting
JoJo reference spotted
I'd like to konw why this is better than regular __init__.
Voice so good
Jojo reference
it works for standard _init_ too. I'm an average so that's what I think
@pmcgee003