[wingide-users] auto completion
Wingware Support
support at wingware.com
Sat Dec 2 19:57:25 MST 2006
On Fri, 1 Dec 2006, Lee Connell wrote:
> I know I posted a while back asking a question about auto completion. I was
> having problems with wing completing some code, reason being it couldn't know
> what type an object was. Someone had told me to use Type() I believe to help
> the editor know what type the object was.
>
> Can someone enlighten me again on this, and offer some assistance of how to do
> this so I can try it out. Any suggestions would be great.
I think you're looking for isinstance(). You can do things like
this:
assert isinstance(self.myvalue, CMyClass)
Or without the assert just:
isinstance(self.myvalue, CMyClass)
And if you need to import a module you don't really want to
import, or just don't want this code executed, you can do
something like this:
if 0:
import mymodule
isinstance(self.myvalue, mymodule.CMyClass)
Hope that helps.
Stephan Deibel
--
Wingware
Wing IDE for Python
Advancing Software Development
www.wingware.com
More information about the wingide-users
mailing list