ignore method/attributes from object class
Brought to you by:
fabioz
when following the PEP8 convention of leading underscores for "protected" and "private" methods, Ctrl-Space code completion becomes almost useless due to being overcrowded with builitin and inherited methods like __str__.
It would be good if there was a way to ignore these __ *suffixed* names, or better, demote them to a second tier of completions, similar to the JDE approach.
alternatively, provide a reference to order the offered completions - i.e. rank method/attribute matches according to depth of inheritance
*preference
Actually, in PyDev 2.1.0, the sorting is already done, so, completions with '_' and '__' will have lower priorities... is that enough?
not really - in this case I am using _ for "protected" and __ for "private" methods, as per standard python conventions. So when I hit type self._ <Ctrl+Space> I want to see protected methods before all the __*___ builtins and object methods. Or, at worst, I would like to see the local methods before builtins.
Just tried this in Pydev 2.1.0, and it seems to sort by name only, though the nice icons are there to show which is which
Just to confirm, the current order just considers '_' and '__', and you'd like it to consider '_', '__' and '__*__', is that it?
yes- if the __*__ names could be pulled out and pushed to the bottom of the sort order, that would good. And as you say, single _ prefixes should rank higher that double __ prefixes (only happens when you assist on a single _ character of course)
In short:
_[^_].* < __.*[^_] < __.*__