Bruce i highly respect Your broad knowledge and experience. So, i have to ask: why don't You said about name of that pattern ? I mean Value Objects. I think there should be more awareness of well known patterns from other languages. Today we adopt many of them to Python (like value objects, dependency injection etc).
Nice talk sir, that is right dataclass dont support given attribute to be frozen, but the library attrs (from which the dataclass idea was lifted) can take care of it 👍
Started using dataclass recently (discovered it reading fluent python 2nd). Don't think it mentioned the attrs library, so I just looked up the docs and I'm wondering why I would not just always use that since it offers more flexibility. Only advantage of dataclass is that its built in?
00:00 - Introduction
01:08 - validation
01:50 - 1_stars
04:14 - 2_encapsulation
07:20 - 3_data_classes
10:29 - 4_frozen_data_classes
11:40 - 5_data_class_stars
16:09 - 6_person
18:54 - 7_birth_date
23:16 - 8_month_data_class
25:02 - Questions
Awesome video.I learnt a lot from this video.
Bruce i highly respect Your broad knowledge and experience. So, i have to ask: why don't You said about name of that pattern ? I mean Value Objects. I think there should be more awareness of well known patterns from other languages. Today we adopt many of them to Python (like value objects, dependency injection etc).
Nice talk sir, that is right dataclass dont support given attribute to be frozen, but the library attrs (from which the dataclass idea was lifted) can take care of it 👍
Started using dataclass recently (discovered it reading fluent python 2nd). Don't think it mentioned the attrs library, so I just looked up the docs and I'm wondering why I would not just always use that since it offers more flexibility. Only advantage of dataclass is that its built in?
@@h82fail it may also be a bit faster, at least in comparison with pydantic; not sure about attrs
Interesting use case, although I'd rather use standard types for the fields and validate them in __post_init__ using specialized functions