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

Phyo Arkar phyo.arkarlwin at gmail.com
Mon Aug 18 08:02:20 MDT 2008


Dear Stephan;

Thank you for your quick response.I  had read in wingide's help that using
*.pi files , it can help introspection . so i try to include the directory -


~/.wingide3/pi-cache/2.5/usr/lib/python2.5/lib-dynload

but still it dosent help.

When i try to look into
~/.wingide3/pi-cache/2.5/usr/lib/python2.5/lib-dynload/_socket.pi

it have all the members that i want to call : eg .

  setsockopt(level, optname, value) -- set socket options
  def setsockopt(self, level, option, value):
    """ setsockopt(lev    """ setsockopt(level, option, value)

    Set a socket option.  See the Unix manual for level and option.
    The value argument can either be an integer or a string. """

    pass

  def bind(self, address):
    """ bind(address)

    Bind the socket to a local address.  For IP sockets, the address is a
    pair (host, port); the host must refer to the local host. For raw packet
    sockets the address is a tuple (ifname, proto [,pkttype [,hatype]]) """

    pass


But it dosen't work  in wingide . Is there anyway to force load _socket.pi
for import socket ?

I had tried to do it from helpers by doing from socket.socket import _socket
but it dont help.




On Mon, Aug 18, 2008 at 1:29 PM, Wingware Support <support at wingware.com>wrote:

> 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
> modules.
>
> 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
> something).
>
> --
>
> Stephan Deibel
> Wingware | Python IDE
> Advancing Software Development
>
> www.wingware.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20080818/6616af8f/attachment.html


More information about the wingide-users mailing list