Filip Gruszczyński wrote:
> I have done some testing and it seems, that it might not be Python
> problem. Well, when I use only pure Python objects, I get really nice
> description of the object (which means the type). But I am using PyQt
> and it seems, that when an object is subclassing QObject (or possibly
> some other class from qt, that can be not derived from QObject) it can
> only display information about the name of the function. PyQt are
> python bindings for C++ qt library. Can this be the reason for not
> displaying type of the object?

Yeah, any time someone implements their own attribute lookup process for
a class (be it via __getattr__, __getattribute__ or the C equivalents),
it is up to the reimplementation to appropriately format their error
message if they raise AttributeError directly.

This could possibly be made easier to do correctly via a specific
AttributeError class method (also exposed through the C API) that
accepted a type object and an attribute name and then produced a nicely
formatted error message the way the builtin types do.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to