Éric Araujo <mer...@netwok.org> added the comment:

> I suggested subclassing to solve the more general problem of the
> caller being able to tell one getopt error from another, for which it
> is a pretty common solution.

Now I see what you meant and understand your request.  optparse has five 
different error classes and argparse has two, but they don’t bubble up to the 
caller, they’re caught and turned into error messages.  getopt is different, 
since it require its users to do the gruntwork, so having different exceptions 
for different user errors would be helpful.  Compatibility would not be an 
issue, we’d just make all classes inherit from GetoptError so that except 
clauses would still work.  I think you should take this to the python-ideas 
mailing list: Do other getopt users need this functionality?  What subclasses 
should there be?

Filip: Localization of error messages in getopt is another enhancement.  Would 
you mind opening another report and moving your patch there?  Thanks.

----------
title: GetoptError strings should be localized -> getopt errors should be 
specialized

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to