[PyKDE] False Attribute Errors

bdw bdw_box at yahoo.co.uk
Mon Feb 7 04:02:05 GMT 2005


After I installed the latest snapshots recently, I started getting what
seem to be false Attribute Errors. The problem affects Qt objects which
I have added properties to like this:

    class MyCustomWidget(QWidget):
        def __init__(self, parent):
            QWidget.__init__(self, parent)
            self.newProperty = 1

If I insert blocks of asserts like this at various places,

    assert hasattr(mywidget,'className')
    assert hasattr(mywidget,'geometry')
    assert hasattr(mywidget,'newProperty')

only the last one ever gives an Attribute Error. That is, the QObject
and QWidget attributes are okay, but not the Python one. The crazy
thing is, it doesn't happen all the time or even in the same sections
of code - so I can't really give any specific samples.

The problem occurs with the following set up:

    sip-20050129, pyqt-20050129, qscintilla-20050122
    python-2.4, qt-3.2.3

I also re-compiled everything using the 20050204 sip snapshot, but it
didn't change anything.

Has anyone else seen this kind of thing? Any help at all would be
welcome as this has really got me stumped!



=====
bdw


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com




More information about the PyQt mailing list