Python里的单下划线,双下划线,以及前后都带下划线的意义:

  1. 单下划线如:_name

    意思是:不能通过from modules import * 导入,如需导入需要:from modules import _name

  2. 对象前面加双下划线如:__name

    意思是:生命对象为私有

  3. 前后下划线如:__int__:python系统自带的一些函数和方法

相关文章:

  • 2022-12-23
  • 2022-01-29
  • 2022-01-11
  • 2022-01-02
  • 2022-12-23
  • 2022-01-17
猜你喜欢
  • 2021-12-07
  • 2022-02-13
  • 2022-12-23
  • 2021-10-29
  • 2021-11-11
  • 2022-12-23
相关资源
相似解决方案