3 ms·
How come it doesn't highlight "self"? I think that is an important enough keyword to be highlighted differently.
by personjerry 11y ago
How come it doesn't highlight "self"? I think that is an important enough keyword to be highlighted differently.
- llimllib 11y agopedantry, but probably relevant to the decision: self is not a keyword at all, it's a conventional choice. (I'd probably elect to highlight it, just saying that it's not a reserved word in any way.)
- mikepurvis 11y agoRather than highlight the specific string "self", instead highlight the first parameter of any non-static class method?
- 1st1 11y agoWell, 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.
- 1st1 11y agoIt's not a keyword in a classic sense, but yeah, we can assign it a distinctive scope. Feel free to open an issue!
- 1st1 11y agoThis has been fixed in the latest release!