Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Break-OO-privacy/Python/break-oo-privacy.py
Normal file
16
Task/Break-OO-privacy/Python/break-oo-privacy.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
>>> class MyClassName:
|
||||
__private = 123
|
||||
non_private = __private * 2
|
||||
|
||||
|
||||
>>> mine = MyClassName()
|
||||
>>> mine.non_private
|
||||
246
|
||||
>>> mine.__private
|
||||
Traceback (most recent call last):
|
||||
File "<pyshell#23>", line 1, in <module>
|
||||
mine.__private
|
||||
AttributeError: 'MyClassName' object has no attribute '__private'
|
||||
>>> mine._MyClassName__private
|
||||
123
|
||||
>>>
|
||||
Loading…
Add table
Add a link
Reference in a new issue