Why is Eclipse python autocomplete adding the self parameter?
I recently started to use PyDev and the method autocomplete seems to be stupid: I select the method name in the dropdown list, click enter and 开发者_如何学JAVAit completes the line adding the self parameter, but in Python you are not supposed to specify the self parameter when you call the methods!?
If you are writing a new method in a Class, it does this. But not if you have previously decorated with for example @staticmethod, this is what gets autocompleted for me in PyDev:
def normal_method(): #nothing gets autoinserted
pass
class Foo:
def instance_method(self): #self gets autoinserted
pass
@staticmethod
def static_method(): # nothing is inserted
pass
@classmethod
def class_method(cls): #cls is autoinserted
pass
Are you sure that you're not in a class when this happens? If you are, then I think it is a reasonable behavior, if not, PyDev is bugging out for you.
精彩评论