I don't quite understand why the google python style guide recommends that
packages and modules we write should avoid using the catch-all except.
Instead the guide encourages you to write domain specific exception classes.

class Error(Exception):
  """..."""

class ThisSpecificError(Error):
  """..."""

class ThatSpecificError(Error):
  """..."""


try:
  ...
except mylib.Error:
  ...

REF.
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Exceptions#Exceptions

Thoughts?
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to