Advanced Exception Handling in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

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

  • @dagpag1
    @dagpag1 ปีที่แล้ว +62

    This should not be labeled as advanced exception handling because it is missing topics like exxeption chaining, traceback, exception hook, signal handling etc

    • @hadialhassan5078
      @hadialhassan5078 7 หลายเดือนก่อน +6

      Would you recommend any resources for those

    • @lgf-sq9yf
      @lgf-sq9yf 5 หลายเดือนก่อน +1

      frfr

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

      @@hadialhassan5078 python distilled is a good book and have these topics you can download it online

    • @AndySiisiEdwenGaisie
      @AndySiisiEdwenGaisie วันที่ผ่านมา

      Frfuri

  • @leftblank5315
    @leftblank5315 ปีที่แล้ว +15

    If you re-raise an exception, you should generally do it so: "raise from e". Internally, it sets a few flags and references the original exception.

  • @NiceChange
    @NiceChange ปีที่แล้ว +7

    This is a great video for understanding the try/except usage in Python. Creating a good knowledge of the fundamentals is essential. Nice work! Thank you.

  • @the_huge_knight
    @the_huge_knight ปีที่แล้ว +2

    Also if you create a class in Python, in its methods you should (catch and) raise some exceptions (if something goes wrong) and catch them in the main function of your program.

  • @imrealgigachad
    @imrealgigachad ปีที่แล้ว +8

    Can you make a video about pynecone ?

    • @AJXD2
      @AJXD2 ปีที่แล้ว

      Dad is that you

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

    Coming from java background we don't have else. We just assumed that the line after the code that throws that exception would run and we would consider that the else. I just use that logic here when programming python. Seems using else would be a step backwards as it puts the code that follows in a different code block much lower on the screen.

  • @aswinmathew2472
    @aswinmathew2472 ปีที่แล้ว +1

    I want to ask a doubt about the neuralintents package
    Can I put a default command like for example if the message I gave dosent match any of the patterns I have listed on the intents file do something or say something as default?

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

    What continue does in exception handling? Pass means ignore but what continue does?

  • @Alexander-ms2ct
    @Alexander-ms2ct ปีที่แล้ว

    Keep doing what you are doing. You aren’t popular. But people care and watch. You are doing good

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

    Trying out Python, I learned you can execute functions right from the console. Is there a way to catch exceptions from functions written and executed directly in the console (not the source code) ?

  • @harrycrab8725
    @harrycrab8725 ปีที่แล้ว +4

    Great video. I’m interested in more advanced topics like implementing traceback, if/when to subclass Exception, and custom errors.

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

    thanks for this, was struggling with this but i "finally" do understand it.

  • @DanieldeWinnaar
    @DanieldeWinnaar 2 หลายเดือนก่อน +1

    epic stuff, thanks man

  • @no_______one
    @no_______one ปีที่แล้ว +2

    I am truly amazed how much knowledge you have and how well you transmit it.
    Every video is truly appreciated, thanks a lot for saving me and thank you in advance for all people that you are going to help in the future 📈

  • @Raiden_Amani
    @Raiden_Amani ปีที่แล้ว

    Thank you so much. You are honestly a very useful and coherent source for beginners, professionals, and all in-between 👍🏾.

  • @Earth.real47
    @Earth.real47 2 หลายเดือนก่อน

    epic man! you explained really well.

  • @Brennmeister
    @Brennmeister ปีที่แล้ว +2

    Is it possible to have something like a watchdog? That checks every 5 sek if a program is still running.
    And is it possible to restart a thread if an error raised an failure.

    • @SP-db6sh
      @SP-db6sh ปีที่แล้ว

      What an practical implementation of this video instantly advised by you ! Amazing.... What's your actual usecase?
      In that case need an decorator function which will restart this child function on awkward return value from it...

    • @Brennmeister
      @Brennmeister ปีที่แล้ว

      @@SP-db6sh oh ok. I will try to solve the problem with
      The watchdog is just something like a ping. Every second try to reach all clients. If there is noch answer stop all processes

  • @rhambosnax864
    @rhambosnax864 ปีที่แล้ว

    Thank you very much. I was really looking for this and you just uploaded it

  • @efox29
    @efox29 ปีที่แล้ว

    Every video is a banger.

  • @mecheng84
    @mecheng84 ปีที่แล้ว

    whats the difference between else and finally block ? they kind of do the same thing.

    • @Harry830
      @Harry830 ปีที่แล้ว +1

      else gets executed when there is no error whereas finally gets executed no matter error or not

  • @beliakovdev8059
    @beliakovdev8059 ปีที่แล้ว

    Glad to watch concise and at the same time such an informative video.💥

  • @Mike-vj8do
    @Mike-vj8do ปีที่แล้ว

    this guy is great, thank you for the video

  • @Schrom
    @Schrom ปีที่แล้ว

    First of all, thanks for this video :)
    Now my comment :D
    I think its a good practice to avoid these try catching if possible. For example if you already know a division by zero could happen, you can check it and if it would be the case you can throw an exception by yourself.

  • @arunbalakrishnan8978
    @arunbalakrishnan8978 18 วันที่ผ่านมา

    Great, thanks for the knowledge....

  • @rfatefehelvacoglu335
    @rfatefehelvacoglu335 ปีที่แล้ว

    i watched this from many channels none of them included what finally does

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

    Nice demo.
    Don't really need "as e" unless you want to use e. It suffices to use except :

  • @iankamandew9777
    @iankamandew9777 ปีที่แล้ว

    Thanks alot man!

  • @EbenHodzi
    @EbenHodzi ปีที่แล้ว

    Good work bro

  • @ilyassgridech7095
    @ilyassgridech7095 29 วันที่ผ่านมา

    thank you this video was too helpfull

  • @kamelboudaoud-qh7od
    @kamelboudaoud-qh7od ปีที่แล้ว

    thank you for all this and i want you make a video about qiskit

  • @knolljo
    @knolljo ปีที่แล้ว

    This is rather basic exception handling

  • @paulthomas1052
    @paulthomas1052 ปีที่แล้ว

    Thanks - very useful !

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

    When did Michael Mando start coding ? 🤣
    Now really, thank you for great lesson.

  • @vihanvalizade1088
    @vihanvalizade1088 ปีที่แล้ว

    that was perfect
    thanks

  • @martinstrnad3243
    @martinstrnad3243 ปีที่แล้ว

    I think it's wrong for the exception handling video to show printing errors to stdout instead of stderr.

  • @amurara3012
    @amurara3012 ปีที่แล้ว

    tks man, u are great

  • @karen-7057
    @karen-7057 8 หลายเดือนก่อน +1

    i wouldnt call this "Advanced". was expecting more.

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

    Thanks

  • @cetilly
    @cetilly 3 หลายเดือนก่อน +1

    NOT advanced topic. Completely misleading title. This was a beginner introduction to exception handling.

  • @YoungTalent777
    @YoungTalent777 ปีที่แล้ว

    I learnt something

  • @NgoanakadiMahoma
    @NgoanakadiMahoma ปีที่แล้ว

    😍😍😍

  • @philtoa334
    @philtoa334 ปีที่แล้ว

    Thx_.

  • @ed223-p5g
    @ed223-p5g ปีที่แล้ว +1

    is this what you call advanced? 🤣

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

    this is basic exception handling, nothing advanced at all

  • @eseajidekpu7536
    @eseajidekpu7536 ปีที่แล้ว +1

    HE NEEDS TO LEARN HOW TO EXPLAIN MORE THOROUGHLY

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

    this is ultra basics of exception handling.. please rename your video

  • @kutilkol
    @kutilkol ปีที่แล้ว

    Whack

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

    This was an Awesome explanation thanks 🫡