[Python-ideas] Copy-on-write when forking a python process
Mike Graham
mikegraham at gmail.com
Wed Apr 13 16:06:27 CEST 2011
On Wed, Apr 13, 2011 at 7:58 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Tue, 12 Apr 2011 23:40:02 -0400
> Terry Reedy <tjreedy at udel.edu> wrote:
>> "Changed in version 2.3: Interned strings are not immortal (like they
>> used to be in Python 2.2 and before); you must keep a reference to the
>> return value of intern() around to benefit from it."
>
> That's a rather strange sentence, because interned strings *are*
> immortal (until the interpreter is shutdown).
>
> Regards
>
> Antoine.
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = intern("asdfqqqq")
>>> id(x)
3078566112L
>>> id("asdfqqqq")
3078566112L
>>> x = []
>>> y = []
>>> id("asdfqqqq")
3078566208L
Does not this suggest otherwise?
Mike
More information about the Python-ideas
mailing list