[Python-Dev] Attribute error: providing type name (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sun Nov 30 22:50:33 CET 2008
- Previous message: [Python-Dev] Attribute error: providing type name
- Next message: [Python-Dev] Attribute error: providing type name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] Attribute error: providing type name
- Next message: [Python-Dev] Attribute error: providing type name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]