Re:MagicStack: Python syntax highlighter for Sublime Text an...
by mikepurvis on Monday October 19, 2015 @10:08PM
(#10417014)
Rather than highlight the specific string "self", instead highlight the first parameter of any non-static class method?
Re:MagicStack: Python syntax highlighter for Sublime Text an...
by 1st1 on Monday October 19, 2015 @10:23PM
(#10417067)
Well, if it's a decorated function, then one of the decorators might consume the first argument. IOW there is no reliable way to tell if the first argument of the method is really "self" or something else. In this very case its better to just stick to the conventional name.
(I'd probably elect to highlight it, just saying that it's not a reserved word in any way.)