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/2011-January/107443.html below:

[Python-Dev] Exception __name__ missing?

[Python-Dev] Exception __name__ missing? [Python-Dev] Exception __name__ missing?Scott Dial scott+python-dev at scottdial.com
Mon Jan 17 22:09:47 CET 2011
On 1/17/2011 3:22 PM, Ron Adam wrote:
> Is this on purpose?

This reminds me of something I ran into a few years ago wrt. the
attribute on exceptions. Namely, that instances of built-in exceptions
do not have a __module__ attribute, but instance of user exceptions do
-- a change which appeared in Python 2.5:

http://mail.python.org/pipermail/python-list/2007-November/1088229.html

I had a use case, using ZSI to provide a SOAP interface, where being
able to get the __module__ and __name__ was needed (to serialize into a
SOAP "fault" message).

I worked around the issue by referencing the __class__ (as the other
replier mentioned). But, I didn't receive any responses then, so I think
not a lot of attention was put into these type of attributes on exceptions.

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu
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