March 2003
Intermediate to advanced
656 pages
39h 30m
English
PyErr_NewException
PyObject* PyErr_NewException(char*name,PyObject*base,PyObject*dict)
Subclasses exception class base, with
extra class attributes and methods from dictionary
dict (normally NULL,
meaning no extra class attributes or methods), creating a new
exception class named name (string
name must be of the form
"modulename.classname“)
and returning a new reference to the new class object. When
base is NULL, uses
PyExc_Exception as the base class. You normally
call this function during initialization of a module object
module. For example:
PyModule_AddObject(module, "error",
PyErr_NewException("mymod.error", NULL, NULL));