gpt4 book ai didi

python - Python 中的真正隐私

转载 作者:行者123 更新时间:2023-11-28 22:04:19 25 4
gpt4 key购买 nike

PEP 8 声明(强调我的):

We don't use the term "private" here, since no attribute is really private in Python (without a generally unnecessary amount of work).

我猜它指的是用其他语言定义实际的类,然后只将公共(public)成员暴露给解释器。有没有其他方法可以在 Python 中实现真正的隐私?

我只是出于好奇才问的。

最佳答案

不,在 Python 中没有什么是真正私有(private)的。

知道方法名就可以获取。

我认为您可能会想出一个聪明的 hack,但也仅此而已 - hack。该语言中不存在此类功能。

关于python - Python 中的真正隐私,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7456638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com