[wingide-users] Could Wing 5 gain some PyQt awareness?

Wingware Support support at wingware.com
Fri Sep 6 13:16:00 EDT 2013

David Cortesi wrote:
> When debugging a PyQt4 program it is something
> of a handicap that the Stack Data display does not
> show the actual text contents of a QString.
> If I create a QString in the interpreter window,
> it clearly has a __repr__() value:
>      qs = QString('xyz')
>      qs
>      PyQt4.QtCore.QString(u'xyz')
> However in the Stack Data, Value column, a QString
> (like all PyQt4/Qt objects) expands into an
> interminable list of class members none (?)
> of which contain the text value.
> This has caused me often to have to insert a
> debugging statement like
>      dbg = unicode(theString)
> just in order to be able to actually see the
> string the code is building.
> It would be great if there were some way to
> restrict the "Value" column to the simple __repr__()
> display string.

There are times when repr is more useful but it's also more dangerous 
for us to call.  There are quite a few libraries out there with __repr__ 
implementations that return huge values and/or get hung up on lengthy 
computations that we cannot interrupt.  We've gone to some lengths to 
predict and avoid this but it's not possible to do this perfectly so we 
still try to avoid it in populating the Stack Data GUI.

What we probably need is a way to ask Wing to use one or the other based 
on the type of the value.

The putting repr(qt) in the Watch tool or using the Debug Probe are two 
ways of dealing with this now.

Thanks for the feedback!


Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list