[wingide-users] Not all variables in debugger window?Wing IDE Support support at wingide.com
Mon, 10 Feb 2003 10:53:38 -0500 (EST)
Hi, This is a result of this class acting like a dictionary by defining keys() and __getitem__() methods but then not returning its internal values through that interface (keys() returns  in your test case). This is probably by design but it isn't particularly useful when working with a debugger. It looks like this class does define __dict__ as well and that does contain the values you're looking for. So we might be able to fix this by preferring use of __dict__ over the above methods during value extraction, although I'm fairly sure that doing so is more often a problem than the way we're doing this now. Cases like this can always be worked around by using the Debug Probe or Expression Evaluator from the Windows menu and typing expressions there (msg._payload or msg.__dict__ in this case will show you the values you want to see). These include a stored history of expressions/values so it's not generally too cumbersome to do this. We'll look into this in more detail and will patch this if it's possible to do so without breaking any more common cases of 'misbehaving' classes. One option would be to try to merge the values returned from the keys()/__getitem__ interface, __dict__, and other access methods we currently use only in a mutually exclusive way. Thanks for pointing out this case! Stephan Deibel -- Wing IDE for Python Archaeopteryx Software, Inc Take Flight! www.wingide.com On Sat, 8 Feb 2003, Rishel,Wes wrote: > Under one odd circumstance not all variables show up in the debugger window. > > For example, in this program: > > import email > msg = email.Message.Message() > msg.add_payload('abc') > print msg._payload > pass <<<BREAKPOINT HERE>>> > > the variable _payload does not show up in the debugger even though the print statement works fine. > > The Message class implements a dictionary interface as seen by this example: > > import email > msg = email.Message.Message() > msg.add_header('def', 'ghi') > print msg[def] # prints 'ghi' > > In the debugger def shows up as a variable with the value ghi. What I might have expected to see is the variable named _headers in which Message stores a list of pairs, but _headers is not there. > > I am sure this is somehow related to the reason I can't see _payload. > > I am wondering if there is some way I can get around this "feature" and see all the variables of the instance of message? It would be particularly convenient if I could do it without editing files in the library. >
Run by Mailman v 2.0.8
Copyright (c) 2000-2002, Archaeopteryx Software, Inc.