« Return to Thread: Exception for setting attributes of built-in type

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

by Michael Foord-5 :: Rate this Message:

Reply to Author | View in Thread

Dino Viehland wrote:

> Guido wrote:
>  
>> 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.
>>    
>
> IronPython is in the exact same boat here - we share built-in types
> Across multiple Python engines as well.
>
>
>  

And indeed it is needed - if you are working with multiple interpreters
(engines in IronPython) you don't want isinstance(something, dict) to
fail because it is a dictionary from a different interpreter...

Michael

> _______________________________________________
> Python-Dev mailing list
> Python-Dev@...
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk
>  


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

 « Return to Thread: Exception for setting attributes of built-in type