Edit: this question is a duplicate of this one; I'm leaving it because I got a helpful answer and I didn't find the other one after reasonable amount of searching (so I hope this one being here will double the liklihood of future searchers finding a solution)
I use elpy with elpy-module-company as one of its modules. when I type
self._", the sorting causes it to propose all the dunders (
__class__, &c) that I don't usually care about.
I name some attributes starting with single underscore. I would like to see
self._method_i_wrote sort before
I see that maybe
company-sort-predicate is what I want, but I don't know
how to write the predicate or tell company to use it. Can anyone give an example?
I think hooking in the sort predicate I could figure out, but defining the sort predicate is beyond my elisp powers.
An i-could-live-with-it solution (for what is admittedly a first world problem) would be a filter that tosses out dunders completely.