Sujet : Re: Too Broad of an exception
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 26. Oct 2023, 18:43:51
Autres entêtes
Organisation : Stefan Ram
Message-ID : <type-20231026184329@ram.dialup.fu-berlin.de>
References : 1 2 3 4 5
Mats Wichmann <
mats@wichmann.us> writes:
Of course, you can put that into the message you pass to the class
instance you raise, but the type of exception is informational too.
|Note: Exception messages are not part of the Python API.
|Their contents may change from one version of Python to the
|next without warning and should not be relied on by code
|which will run under multiple versions of the interpreter.
The Python Language Reference, Release 3.13.0a0
So, when it comes to the standard library, /only/ the type
of exception is informational (for interpretation by code).