Environment data
- Pylance version: v2026.1.1
- OS and version: Windows 11
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.13.7
Code Snippet
class SomeClass:
def update_trees(self)->None:
...
def some_method(self, update_trees:bool)->None:
if update_trees: # <-- issue occurs while typing this
self.update_trees()
Repro Steps
- Create a class with an instance method named "update_trees"
- Create another instance method that accepts a parameter named "update_trees"
- Start typing something that triggers the autocomplete suggestion for "update_trees"
- Select the first autocomplete suggestion
- The symbol is changed to "self.update_trees"
Expected behavior
When typing "upd" inside some_method, the local parameter update_trees should be the top completion suggestion (accepting the top suggestion should insert "update_trees" instead of "self.update_trees").
Actual behavior
After the 2026.1.1 update (which added self. completions via #5773), "self.update_trees" is the top suggestion. Pressing Enter inserts "self.update_trees" instead of the local parameter "update_trees". This is incorrect in context — the method's parameter should take priority over the instance method when names collide.
Request
- When a local variable/parameter shares a name with an instance method or attribute, the local symbol should be prioritized in completions.
- Alternatively, please add a setting that controls this autocompletion behavior (or disables self. completions entirely).
Environment data
Code Snippet
Repro Steps
Expected behavior
When typing "upd" inside some_method, the local parameter update_trees should be the top completion suggestion (accepting the top suggestion should insert "update_trees" instead of "self.update_trees").
Actual behavior
After the 2026.1.1 update (which added self. completions via #5773), "self.update_trees" is the top suggestion. Pressing Enter inserts "self.update_trees" instead of the local parameter "update_trees". This is incorrect in context — the method's parameter should take priority over the instance method when names collide.
Request