I for the life of me can not remember how to test for the instination of a python class.
It was something like:
try:
m = MyModel()
except:
...
I can't remember the exception to call or the assert to use.
There is no common exception to use for failed instantiation. The constructor (both __init__ and __new__) can raise any exception it wants. The except statement you have without an explicit exception will catch every type of exception, which may be what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With