Even though self is not a reserved keyword and just a strong convention it is written in red in my sublime text code. But if I change it to 'this' for example it will get white. Why is that so?
In Python nearly everything is an object that can be referenced by self.
To display this there seems to be a common agreement upon IDE manufacturers to treat this keyword as special.
On the other hand "This" in python is basicly replaced by self because of the object-inherited self-attribute. Therefore "This" in python interpreter is recognized as simple word-/name-tag (like in variable names). But i would strongly advice you not to use it to not confuse yourself and other code readers.
My sublime text shows 'self' in python methods in a different color even though it is not a reserved keyword. Why?