I don't think you're lucky with that. The problem is that it is actually quite difficult to statically infer the type of variables in Python, except in the simplest case. Often the type is not known until runtime, so automatic completion is not possible.
The IDE does some static analysis to work out the obvious and best guesses, but I'm betting it doesn't even try to use elements in the container. Although we may decide that b is of type A , even small variations of your code can make it unrecognizable, especially since it is in a mutable container.
By the way, I tried this on the full Komodo platform, and it is not better. I heard that the Wing IDE has excellent code completion, but I'm not sure if it can do better either.
Scott griffiths
source share