4 ms·
String interning has nothing to do with static typing. AFAIK Ruby supports it with symbols and Python with strings in general.
by m0th87 12y ago
String interning has nothing to do with static typing. AFAIK Ruby supports it with symbols and Python with strings in general.
- riffraff 12y agoRecent rubys also supports it for frozen strings (which is the reason it's a frozen string in the commit, probably). The reason it's not done by default is that with mutable strings it would be more complicates/would require a different string implementation, I guess.