by seasonalgrit · 9y ago · 0 comments
This is intended to avoid risks of collisions for classes built specifically for inheritance so you'd usually use it with attributes e.g. `self.__name = name` (that way if a subclass defines its own "name" things will work as expected for both). I was unaware this also worked for straight local variables.
I was unaware it happened for all symbols, but I guess it makes sense as the Python compiler does very little analysis.