[wingide-users] Autocomplete __name__

Wing IDE Support support at wingware.com
Fri Oct 18 14:20:43 MDT 2013


On 10/18/13 2:45 PM, Mike Driscoll wrote:
> This is probably me just being lazy, but Wing's autocomplete is so handy
> that I always miss it when it won't autocomplete __name__ when I am
> typing the following typical construct:
>
> if __name__ == "__main__"
>
> I notice Wing will happily recognize __name__ after I have typed it out
> as it changes color. And Wing will autocomplete double-underscore items
> from classes, so I don't really know why it's autocomplete doesn't work
> in this instance.

Yes, this is surprising and we'll try to add __name__ to the list in a 
future release.

> Is there a way to enable it? Or perhaps create one of those cool
> autocomplete snippets for it?

You could also define a snippet for if __name__ == "__main__": by using 
add snippet from the right click menu in the Snippets tool.  The 
contents of the snippet would be similar to:

if __name__ == '__main__':
      |!|

Cheers,

John



More information about the wingide-users mailing list