SAVE TIME and reduce boilerplate with dataclasses

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น •

  • @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 19 วันที่ผ่านมา

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

    • @cbernier3
      @cbernier3 46 นาทีที่ผ่านมา

      @@BrianWoodruff-Jr Sure, but there are plenty of existing videos about that already. New videos should be new things.

  • @haykor7165
    @haykor7165 หลายเดือนก่อน

    First