推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
cson
V2EX  ›  Python

请教各位大神, Python 面向对象编程时的数据保护问题,私有变量也是可以访问的啊???

  •  
  •   cson · Mar 21, 2018 · 1639 views
    This topic created in 3109 days ago, the information mentioned may be changed or developed.
    1 replies  •  2018-03-27 22:53:23 +08:00
    returnYves
        1
    returnYves  
       Mar 27, 2018
    单下划线的属性,from 导入不可用

    双下滑线的属性可以根据类名私有属性来访问
    python 本身一个脚本语言,算是一种灵活性
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2554 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 01:50 · PVG 09:50 · LAX 18:50 · JFK 21:50
    ♥ Do have faith in what you're doing.