Python leading underscore _variables

后端 未结 2 1890
野的像风
野的像风 2020-12-06 10:09

We know that in a class, functions starting with __function__ do not get imported while using:

from module import *

Someone as

2条回答
  •  感情败类
    2020-12-06 10:34

    A variable name starting with an underscore is a strong hint that this variable should be viewed as private.

    Read http://docs.python.org/tutorial/classes.html#private-variables

提交回复
热议问题