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/2008-December/083811.html below:

[Python-Dev] Attribute error: providing type name

[Python-Dev] Attribute error: providing type name"Martin v. Löwis" martin at v.loewis.de
Tue Dec 2 00:10:57 CET 2008
Alex Martelli wrote:
> I wonder if there's some desiderata left for future Python versions to
> make this standard behavior easier (for C-coded, Python-coded, and
> Cython-coded classes, ones made by SWIG, etc) without too much black
> magic...

I think the standard exception hierarchy should grow additional standard
fields. E.g. AttributeError should have attributes 'type','name', or
perhaps even 'object','name'. TypeError should have attributes
'expected', 'actual' (or, again, 'expected', 'object'). Also, some
languages support nested exceptions (attribute 'inner'); usefulness of
this concept should be reviewed.

And so on - that might produce quite a large PEP. As 3.0 missed the
chance to fix this, compatibility is also an issue. It might be possible
to overload exception constructors on the number of parameters, or using
keyword parameters for the new way of filling the exception.

And no, I don't volunteer to write this PEP :-)

Regards,
Martin
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