[BangPypers] An interesting beginner post at Stackoverflow

Roshan Mathews rmathews at gmail.com
Wed Oct 21 09:43:31 CEST 2009


On Wed, Oct 21, 2009 at 12:31 PM, Anand Chitipothu <anandology at gmail.com> wrote:
>    ``Intern'' the given string.  This enters the string in the (global)
>    table of interned strings whose purpose is to speed up dictionary lookups.
>    Return the string itself or the previously interned string object with the
>    same value.
>

Thanks, I didn't know of that.  It could be useful sometime.  Anyways,
for the current discussion intern-ing is irrelevant.

>>> id('superman')
30792544
>>> id('superman')
30792544
>>> id('superman')
30792544
>>> id('superman')
30792544
>>> id('superman')
30792544
>>> id('super man')
31955768
>>> id('super man')
31955488
>>> id('super man')
31956768
>>> id('super man')
31955768
>>> id('super man')
31955488

Also, http://mail.python.org/pipermail/tutor/2009-July/070157.html

Roshan Mathews


More information about the BangPypers mailing list