python try except and best practices (beginner - intermediate) anthony explains #359

preview_player
Показать описание
today I talk about the best practices I try to stick to when working with `try` / `except` in python!

==========

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!
Рекомендации по теме
Комментарии
Автор

I love how his haircut evolves through the episodes, as well as my knowledge after watching them! Keep it up, very enlightening :)

qsuifyt
Автор

I am so grateful to all the Anthony explains videos that I get to see all of them early in my career. Would have taken me some time to learn a lot of the concepts on my own.

pradhvanbisht
Автор

Personally I prefer: try-except-else-finally
over: try-except-finally-else
Having the finally at the end makes imho more sense. Since it runs after else.

JakubYTb
Автор

When talking about exceptions, I would also mention, what return statement in the various blocks does.
For me it was confusing at the beginning, so maybe it would help others.
For example:
try:
foo()
return a
except:
...
else:
return b
finally:
return c

JakubYTb
Автор

Nice compeehensive guide to exceptions. Thanks. It is good reminder for all of that thing.

marsma
Автор

That was great. I felt pretty confident in my exception handling, but that was very informative.

AceofSpades
Автор

good one! prob worth noting not all try-except languages (e.g. JS) have the else case.

jrib
Автор

can you also demonstrate
1) Nested Try /Except
2) A try except inside a while-loop, for example, i have 10 id need to update or do whoever from the db, and any one of the action is fail, do you show a guide on this?
thanks

apexyu
Автор

You're a great teacher, thank you! 😃

elenaperez
Автор

I've never seen a keyboard in half.. but somehow it looks more practical haha

sotirigeorgiou
Автор

Do you have any thoughts to share on `raise...from...`?

joshsnyder
Автор

Hi, explain pls variadic generics (pep646) in py310

lonterel
Автор

I can't read what you're typing

aikimark