David Hopwood wrote: > A restricted interpreter refuses access to any object attribute or method > with a name beginning with '_' (by throwing a new exception type > 'InternalAccessException'), unless the access is from a method and its > static target is that method's first argument variable.
What's to stop def my_naughty_method(self): self = some_protected_object self._a_special_attribute = some_naughty_value > __init__ is an internal method. This is as it should be, because it should not > be possible to call __init__ on an existing object; only to have __init__ > implicitly called when a new object is constructed. What about calling an inherited __init__ method? Your proposed rule would seem to disallow BaseClass.__init__(self, ...) -- 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