python: exception catching and isinstance gotcha (beginner - intermediate) anthony explains

Sdílet
Vložit
  • čas přidán 23. 02. 2021
  • today I talk about exception handling in python, how to handle multiple types, how to handle variables types, and the difference between `except` and `isinstance`
    - NoReturn vs None: • python return annotati...
    - don't use blank except: • what's wrong with pyth...
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/asottile
    stream github: github.com/anthonywritescode
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
  • Věda a technologie

Komentáře • 6

  • @someoneanonymous6707
    @someoneanonymous6707 Před 3 lety +1

    Thanks for the awesome explanation! Now it makes more sense, even it does feel like a bug xD

  • @adwaithrajesh596
    @adwaithrajesh596 Před 3 lety +1

    in which video did you explain this syntax
    raise ValueError("Some error") from None. I cannot find it 😢

    • @anthonywritescode
      @anthonywritescode  Před 3 lety +1

      czcams.com/video/wc6W-RaMJ7k/video.html
      I looked for `raise from` on github.com/anthonywritescode/explains

  • @arclight7401
    @arclight7401 Před 3 lety +1

    2:28 how would the ordering work? aka if u have 2 exceptions on the same level (I assume AssertionError would be catched before Exception?) which would be catched?

  • @spidermila
    @spidermila Před 3 lety +1

    Bug is an unexpected behavior so that thing is a bug :-)