Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Infer types that use similar names (via Reddit) #80

davidhalter opened this Issue Dec 11, 2012 · 1 comment


None yet
1 participant

davidhalter commented Dec 11, 2012

If completions fails we could use a different approach to fetch types, Megatron_McLargeHuge describes one:

However, in general you could autocomplete members that you saw used elsewhere in the code when you can infer that two objects have the same unknown or incomplete type. Do if I call x.foo() somewhere, and y is the same type as x, y probably has a foo() method too. Also, if I have a function with parameter x and I call x.foo(), you could search the code for other objects where z.foo() is called. Then x could autocomplete methods defined on z's type, or invoked on z if z's type is unknown. It would be a usability question whether to err on the side of more or fewer potential completions. If the method name is unique across known classes, that's a pretty strong type hint, while calling __repr__ is not.

Source: http://www.reddit.com/r/Python/comments/14mmsc/finally_an_autocompletion_library_for_python_that/


davidhalter commented Mar 14, 2014

Too much magic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment