How To Create Custom Exceptions In Python

preview_player
Показать описание
In this video I will be showing you how you can easily create your own custom exceptions in Python easily.

▶ Become job-ready with Python:

▶ Follow me on Instagram:
Рекомендации по теме
Комментарии
Автор

This channel is pure golden. Thanks a lot for another useful content🙏

softwareengineer
Автор

I really love your videos, I've been learning a lot of them

AlbieryRodriguez
Автор

I only have one question, why would someone want to serialize an exception object using pickle?

reezuleanu
Автор

Can you do a video explaining pickling?

ego-lay_atman-bay
Автор

Pickling an Exception seems pretty random. What are use cases for it? Why would I want to pickle my custom Exception?

LegionLeague
Автор

Hey love your tutorials. They are amazing. I was wondering though why you didnt use value: any, as it would also work

navidyaghmaei
Автор

Your tutorials are awesome! But I was just wondering what IDE are you using? It looks awesome.

striatp
Автор

Why is pickle important and when is it useful.

tochimclaren
Автор

Life goals: "build a library called meeseeks"

TasCashGr
Автор

Great video!
I do have a question: If you want to create a custom exception with only a message I usually do:

Class MyException (Exception):
...

And it does the trick, ¿Is there a cleaner way to do it? Because it feels kind of bungle 😅

victorgomez
Автор

So, we Can expand try, except in Python with this method.

cihansenatak
Автор

Too bad pickling should never be used, ever, due to the possibility of malicious code being injected.

Lolwutdesu
Автор

class HardwareError[T](Exception):
def __init__(self, message: str, value: T):
super().__init__(message, value)

@property
def message(self) -> str:
return self.args[0]

@property
def value(self) -> T:
return self.args[1]

skewty