Closed
Description
Hey guys, I'm pretty excited about your course and job you have done to make it, that's really thorough work.
But sometimes I'm getting a bit confused when seeing double underscores in functions/variables names in various 100DaysOfWeb chapters.
I know that those are used as super-private
objects or relative, but can you guys explain me as experts, what is reason to not use a single forward underscore as conventional privacy in python but use double underscores?
For instance, please take a look at a code snippet below (chapter 33-36). Can't we use just self._result
name instead of self.__result
here to mark that it should be a private one?
class switch:
__no_result = uuid.uuid4()
def __init__(self, value):
self._found = False
self.__result = switch.__no_result
Do you think it's worth to mention that somewhere in a course? thx
Metadata
Metadata
Assignees
Labels
No labels