Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19332 > unrolled thread

Re: String interning in Python 3 - missing or moved?

Started byChris Rebert <clp2@rebertia.com>
First post2012-01-24 00:33 -0800
Last post2012-01-24 00:33 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: String interning in Python 3 - missing or moved? Chris Rebert <clp2@rebertia.com> - 2012-01-24 00:33 -0800

#19332 — Re: String interning in Python 3 - missing or moved?

FromChris Rebert <clp2@rebertia.com>
Date2012-01-24 00:33 -0800
SubjectRe: String interning in Python 3 - missing or moved?
Message-ID<mailman.5021.1327394031.27778.python-list@python.org>
On Tue, Jan 24, 2012 at 12:17 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
> Chris Angelico, 24.01.2012 05:47:
>> Lua and Pike both quite happily solved hash collision attacks in their
>> interning of strings by randomizing the hash used, because there's no
>> way to rely on it. Presumably (based on the intern() docs) Python can
>> do the same, if you explicitly intern your strings first. Is it worth
>> recommending that people do this with anything that is
>> client-provided, and then simply randomize the intern() hash?
>
> If you want to encourage them to fill up their memory with user provided
> data in a non-erasable way,

Actually, quoth intern()'s docs:
"Interned strings are not immortal; you must keep a reference to the
return value of intern() around to benefit from it."

Cheers,
Chris

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web