autocomplete and stringio

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

autocomplete and stringio

Jonathan Ellis
from cStringIO import StringIO
f = StringIO()
f.[autocomplete]

Wing thinks f is a string, not a stringio ... ?

-Jonathan

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete and stringio

Wing IDE Support
On Thu, 25 Aug 2005, Jonathan Ellis wrote:
> from cStringIO import StringIO
> f = StringIO()
> f.[autocomplete]
>
> Wing thinks f is a string, not a stringio ... ?

Indeed, our stdlib scraper is doing the wrong thing in this case.

A quick hack to fix this is to change cStringIO.pi in
resources/builtin-pi-files/#.# (where #.# is your Python version
number) inside your Wing installation so the last def is:

def StringIO(s=None):
  """ StringIO([s]) -- Return a StringIO-like stream for reading or writing """
  import StringIO
  return StringIO.StringIO()

(However, if you do stuff like this to your Wing installation please
be sure to uninstall Wing and remove any remaining files before
attempting an upgrade in the future; otherwise the upgrade may fail)

I'll look into why this is being generated wrong.

Thanks for the bug report.

Stephan Deibel

--
Wingware
Wing IDE for Python
Advancing Software Development

www.wingware.com
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete and stringio

Jonathan Ellis
Wingware Support wrote:

> On Thu, 25 Aug 2005, Jonathan Ellis wrote:
>
>>from cStringIO import StringIO
>>f = StringIO()
>>f.[autocomplete]
>>
>>Wing thinks f is a string, not a stringio ... ?
>
>
> Indeed, our stdlib scraper is doing the wrong thing in this case.

Another (different?) case:

import threading
t = threading.Lock()
t.[cannot infer type]

I can see how threading might be a bitch to infer types in though. :)

-Jonathan
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide