what does the double underscore __ mean in python? -
this question has answer here:
what double underscore indicate in python? remember reading tutorial said had hidden variable, feel there more , keep seeing examples of code have double underscores , don't understand means.
from pep 8:
__double_leading_underscore
: when naming class attribute, invokes name mangling (inside class foobar,__boo
becomes_foobar__boo
; see below).__double_leading_and_trailing_underscore__
: "magic" objects or attributes live in user-controlled namespaces. e.g.__init__
,__import__
or__file__
. never invent such names; use them documented.
Comments
Post a Comment