mirror of
https://github.com/python/cpython.git
synced 2024-12-01 11:15:56 +01:00
0aa9ee65ab
The raise logic has one additional feature: if you raise <class>, <value> where <value> is not an instance, it will construct an instance using <value> as argument. If <value> is None, <class> is instantiated without arguments. If <value> is a tuple, it is used as the argument list. This feature is intended to make it easier to upgrade code from using string exceptions to using class exceptions; without this feature, you'd have to change every raise statement from ``raise X'' to ``raise X()'' and from ``raise X, y'' to ``raise X(y)''. The latter is still the recommended form (because it has no ambiguities about the number of arguments), but this change makes the transition less painful. |
||
---|---|---|
.. | ||
atof.c | ||
bltinmodule.c | ||
ceval.c | ||
cgensupport.c | ||
compile.c | ||
dup2.c | ||
errors.c | ||
fmod.c | ||
frozen.c | ||
frozenmain.c | ||
getargs.c | ||
getcompiler.c | ||
getcopyright.c | ||
getcwd.c | ||
getmtime.c | ||
getopt.c | ||
getplatform.c | ||
getversion.c | ||
graminit.c | ||
hypot.c | ||
import.c | ||
importdl.c | ||
importdl.h | ||
Makefile.in | ||
marshal.c | ||
memmove.c | ||
modsupport.c | ||
mystrtoul.c | ||
pythonmain.c | ||
pythonrun.c | ||
sigcheck.c | ||
strdup.c | ||
strerror.c | ||
strtod.c | ||
structmember.c | ||
sysmodule.c | ||
thread_cthread.h | ||
thread_foobar.h | ||
thread_lwp.h | ||
thread_nt.h | ||
thread_os2.h | ||
thread_pthread.h | ||
thread_sgi.h | ||
thread_solaris.h | ||
thread.c | ||
traceback.c |