Вопрос

I am using Komodo 7 for writing my django/python code.

There is one thing that I really liked when I used Eclipse for my python stuff and it was that I could do :

assert isinstance([variable],[type])

and by that help eclipse determine the coding completion for the specific variable.

Is there any way to do it using Komodo ? the IsInstance trick doesn't work here.

Это было полезно?

Решение

The answer (by interjay) to this similar question suggests you can add hints like:

if 0: foo = Bar()

in places where you're used to using

assert isinstance(foo, Bar)

Not as pretty, of course...

EDIT: it works for me, with Komodo Edit 6.0.3 and Komodo Edit 8.0.0

EDIT: I also found this, which indicates there is no other way (and unlikely to be soon).

Другие советы

Go to Edit > Preferences. 
Expand the "Languages" group by clicking the [+] symbol. 
Click "Python". 
Click the little "Add..." button under "Additional Python Import Directories". 
Add the directory ABOVE your project and you should have intellisense enabled.

This will allow you to see code completion for your project files (Django)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top