HallÃchen! I write a module, and so I must raise exceptions at several points. The PEP 8 says that a module should define their own exceptions base class, derived from "Exception", and derivatives of that.
However, the build-in exceptions cover most of the error types that occur in a standard program. For example, my module communicates with measurement instruments, so any communication error would fit perfectly to the build-in "IOError", wouldn't it? Invalid arguments can raise "TypeError"s, and so on and so forth. Is it considered good style to raise build-in exceptions whereever one thinks it's appropriate? Is the definition of module exceptions derived from "IOError", "TypeError" etc. a good idea? Is there some sort of style guide for recommended exceptions design in Python? Thank you! TschÃ, Torsten. -- Torsten Bronger, aquisgrana, europa vetus -- http://mail.python.org/mailman/listinfo/python-list