Komodo Python auto complete: type inference by variable metadata?

后端 未结 2 403
无人及你
无人及你 2020-12-10 07:30

I\'m using Komodo Edit for Python development, and I want to get the best out of the auto complete.

If I do this:

a = A()
a.

I can

2条回答
  •  天命终不由人
    2020-12-10 08:13

    This doesn't really answer your question, but with Wing IDE you can give hints to the type analyzer with assert isinstance(b, A). See here. I haven't found a way to do it with Komodo, though apparently it's possible when writing PHP or JavaScript.

    Update:

    I've found a way to trick Komodo into doing this:

    if 0: b=A()
    

    This works (at least on Komodo 5.2) and has no side effects, but is sure to confuse whoever reads your code.

提交回复
热议问题