A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053757.html below:

[Python-Dev] Tidier Exceptions

[Python-Dev] Tidier Exceptions [Python-Dev] Tidier ExceptionsAahz aahz at pythoncraft.com
Sat May 14 20:34:29 CEST 2005
On Fri, May 13, 2005, Greg Ewing wrote:
> Brett C. wrote:
>> 
>> Seems like, especially if we require inheritance from a base
>> exception class in Python 3000, exceptions should have standard 'arg'
>> and 'traceback' attributes with a possible 'context' attribute (or
>> always a 'context' attribute set to None if not a chained exception).
>
> Instead of an 'args' attribute, I'd suggest that the constructor take
> keyword arguments and store them in corresponding attributes. Then
> interested parties could retrieve them by name instead of having to
> remember their positions in the args tuple of the exception class
> concerned.

Sounds reasonable, but it should be equally easy to handle::

    raise MyError, "message"
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"And if that makes me an elitist...I couldn't be happier."  --JMS
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4