Talk - Bruce Eckel: Making Data Classes Work for You

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

Комментарии • 7

  • @havanagrawal5178
    @havanagrawal5178 2 года назад +1

    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

  • @amarjeeth123
    @amarjeeth123 2 года назад

    Awesome video.I learnt a lot from this video.

  • @Nalewkarz
    @Nalewkarz 2 года назад +1

    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).

  • @obed818
    @obed818 2 года назад

    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 👍

    • @h82fail
      @h82fail 2 года назад

      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?

    • @mateuszbaginski5075
      @mateuszbaginski5075 2 года назад

      @@h82fail it may also be a bit faster, at least in comparison with pydantic; not sure about attrs

  • @mateuszbaginski5075
    @mateuszbaginski5075 2 года назад

    Interesting use case, although I'd rather use standard types for the fields and validate them in __post_init__ using specialized functions