Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FIOC exception classes

Name: Anonymous 2012-05-30 5:35

Which approach do you prefer:

1. Create new exceptions for each class of error in your libs.

2. Just use stuff from the exceptions module most of the time and create new exceptions when using a standard one is really inappropriate.

My colleagues strongly prefer #1, and go around making dozens of FilePermissionsError or ValueErrorBecauseFuckYou.  They are also OOP and Patterns nuts.  I am not a very happy man because I have to import their horde of bullshit exceptions into my modules instead of just using standard classes.

Name: Anonymous 2012-06-22 4:49

>>35
FORCED INSPECTION OF CODE


C:/usr/share/pyshared> grep -rIE 'class .*?\(Exception' * | grep    -E '^[^:]*?exception[^:].+?:' | wc -l
23
C:/usr/share/pyshared> grep -rIE 'class .*?\(Exception' * | grep -v -E '^[^:]*?exception[^:].+?:' | wc -l
447


23 exceptions in files with exception in their name, 447 exceptions elsewhere.  However, projects using the former approach include pretty much everything I have installed for web (jinja2, mako, django, werkzeug, beaker etc).

It seems that if you program for web, it is customary to put your exceptions into a single module so that there will be NO EXCEPTIONS in other modules.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List