SAVE TIME and reduce boilerplate with dataclasses

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

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

  • @JohnMitchellCalif
    @JohnMitchellCalif Месяц назад +2

    I started using dataclasses after your last video -- very useful. This video makes the other features much more concrete. Thanks so much!

  • @samjiman
    @samjiman Месяц назад +1

    I knew about dataclass, but I didn't know about field. Thanks.

  • @dragonfly-7
    @dragonfly-7 Месяц назад

    Hm, at 01:32 I'm confused a little - at least ... Wouldn't be the 3rd line something like "DIVERSE" the preferred one followed by "USER_SPECIFIED" ?

  • @eduferreyraok
    @eduferreyraok Месяц назад

    great video! quick question: how can I match your zsh settings? the snake icon and branch name etc etc?

    • @Carberra
      @Carberra  Месяц назад

      There's a video link the in description! The terminal one.

  • @saisuapalli
    @saisuapalli Месяц назад

    Haven't verified it, but having different hashes in the same object per execution should be necessary for security reasons, wouldn't it?

  • @TakeshySun
    @TakeshySun Месяц назад +1

    I've used attrs, and u know, for debug class initialisation was a pain in my ass. Also if we want to make crazy initialisation logic, need to use base python constructor :( Because lambda is cool, but debug :)

    • @maleldil1
      @maleldil1 Месяц назад

      At least with stdlib's dataclasses, you can just define your own `__init__` method, and dataclass won't override it.

  • @cbernier3
    @cbernier3 Месяц назад

    Are you programming straight on windows? I only program on WSL. Programming on Windows is silly because you are gonna deploy to linux. You're creating extra heacaches when you need to port that from windows to linux. The vscode remote extension let's you code in WSL, on remote servers, and straight into Docker containers. I got my team off coding straight on windows and into WSL back in 2019.

    • @Carberra
      @Carberra  Месяц назад

      Oh god no, I mainly use a Mac for coding, including videos. I used to code on WSL though as at the time it was more stable then trying to dual-boot with Linux on my old laptop and it was pretty nice.

  • @cbernier3
    @cbernier3 Месяц назад

    dataclasses aren't new though. They came out in 2018.

    • @Carberra
      @Carberra  Месяц назад +4

      So?

    • @BrianWoodruff-Jr
      @BrianWoodruff-Jr 12 дней назад

      New people come to Python all the time. Stuff like this is nice for them to know.

  • @haykor7165
    @haykor7165 Месяц назад

    First