
Jan. 27, 2009
8:07 p.m.
Just set a size limit, e.g. 30 or 100. It's just a heuristic. I believe somewhere in Python itself I intern string literals if they are reasonably short and fit the pattern of an identifier; I'd worry that the pattern matching would slow down unpickling more than the expected benefit though, so perhaps just a size test would be better.
Ok. So, Jake, it's back to my original request - please submit this to the tracker (preferably along with test cases). Regards, Martin