[wingide-users] BUG? Introspection fails on socket module

Wingware Support support at wingware.com
Mon Aug 18 07:29:52 MDT 2008

Phyo Arkar wrote:
> I am new to WIngIDE , i was user of Komodo and Pydev but those ides 
> fails to introspect in many case where wingide does perfect.
> But it seems that some simple stuff , which are introspected well in 
> ohter IDES do not introspect in wingIDE at all..
> I think those are due to extension modules written in  other langauges 
> but non Thirdparty module and well used module , such as socket should 
> be fully introspected .
> let see  this code :
> import socket
> serv = socket.socket()
> serv.setsock  #  It wont do auto completion for setsockopt()
> But when i try in build in - Python Shell console , it introspect wells! 
> even gives sourceassist well!
> so whats happens inside the editor ?Is that a bug ?am i doing something 
> wrong ?

Some of the sockets module does runtime class creation (see the code
that calls exec around line 191 in Python 2.5.2) and Wing's static
analyzer cannot understand that code because it does not execute
Python code.

In the Python Shell, Wing is sourcing its completion data instead
from real runtime introspection so you will get completions/etc
for these cases.  This is true of Wing Pro's Debug Probe also, and
it can be used to get true completion/etc in the real runtime state
of your code.

I suspect other IDEs are using previously "scraped" and stored runtime
introspection on modules like socket and thus not missing these methods
on the socket object.  We may try to merge in the result of introspecting
live loaded modules in the future, since we already do that for extension

Static analysis is still better for many things where executing code would
be impossible (i.e. it's broken) or dangerous (it deletes files or


Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list