A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-July/067733.html below:

[Python-Dev] Internal namespace proposal

[Python-Dev] Internal namespace proposal [Python-Dev] Internal namespace proposalGreg Ewing greg.ewing at canterbury.ac.nz
Thu Jul 27 09:14:27 CEST 2006
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
More information about the Python-Dev mailing list

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