David Hopwood wrote: > Inheritance should be defined as though the code of inherited methods and > attributes were copied into the subclass (with global accesses updated to > point to the original module). You'll have to propose an implementation strategy for that which works without actually copying all the code, though. > Since x._hidden is not accessible from attack.py, the attack fails. But if _hidden were an attribute of the A instance that you were trying to protect, it would succeed. So you can't actually protect any direct attribute of a class that can be subclassed. Which means we're back to the situation of having to prevent access to class objects. -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4