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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to