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/2009-June/090058.html below:

[Python-Dev] Exception for setting attributes of built-in type

[Python-Dev] Exception for setting attributes of built-in type [Python-Dev] Exception for setting attributes of built-in typeGuido van Rossum guido at python.org
Mon Jun 15 16:48:33 CEST 2009
On Sun, Jun 14, 2009 at 4:19 PM, Guido van Rossum<guido at python.org> wrote:
> In general, CPython isn't always consistent in raising AttributeError
> and TypeError when it comes to such policy issues: there are various
> places that raise TypeError in typeobject.c (and probably elsewhere)
> that simply forbid setting a specific attribute (another example is
> __name__).

I should add that this policy is also forced somewhat by the existence
of the "multiple interpreters in one address space" feature, which is
used e.g. by mod_python. This feature attempts to provide isolation
between interpreters to the point that each one can have a completely
different set of modules loaded and can be working on a totally
different application. The implementation of CPython shares built-in
types between multiple interpreters (and it wouldn't be easy to change
this); if you were able to modify a built-in type from one
interpreter, all other interpreters would see that same modification.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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