Ability to define color of the word "self"


263
views
-2
5 months ago by

PyCharm lets you define the color of the word "self" just because it's used all over the place and is sort-of ignored when reading. I think it's a nice feature.

Community: Wing Python IDE

Would you want it colored as a keyword?

written 5 months ago by Wingware Support  

I think it would be a separate color category of it's own ('self' parameter) or something, since it is expected but is not technically any different from other parameters. You could just color the word itself or if you do some code analysis, you could color whatever word is in that parameter position for that function.

Another nice color category would be predefined Python functions like "__init__" and "__str__"

written 5 months ago by Ivan DelSol  

On second thought, it is different from other parameters, as it is provided automatically. So, the code analysis method probably makes way more sense than just coloring the string "self"

written 5 months ago by Ivan DelSol  

We might add support for this in the future.  Wing uses the scintilla's python lexer for syntax highlighting, which would support coloring self as a keyword.  Other options would be more difficult to implement.

written 5 months ago by Wingware Support  

That'd be a fine start for my purposes. I found it pretty nice that "self" was colored in PyCharm.

written 5 months ago by Ivan DelSol  

Similar posts:
Search »