Can't get items out of a set?

castironpi at gmail.com castironpi at gmail.com
Sat Mar 8 15:27:18 EST 2008


> something something equivalence class.

> The intern() builtin uses this approach:
>
>    interned = {}
>    def intern(s):
>         if s in interned:
>             return interned[s]
>         interned[s] = s
>         return s

If you've seen it before, and have the old one, return the old one.
Do I have this straight?



More information about the Python-list mailing list