r/pythontips • • May 10 '21

Syntax String Interning in Python: A Hidden Gem That Makes Your Code Faster

I didn't know this mechanism for the first time of using Python. But when I found it, I think it's really a hidden gem to speed up string comparisons.

Full article:

String Interning in Python: A Hidden Gem That Makes Your Code Faster

87 Upvotes

7 comments sorted by

3

u/K3ystr0k3 May 11 '21

Jesus, this is brilliant.

2

u/RoboticElfJedi May 11 '21

Worth a read, thanks for that.

1

u/flippant9 May 11 '21

Any content or link that doesn't require signing up?

2

u/JRRudy May 11 '21

It didn't ask me to sign in to anything on mobile

2

u/mrmilanga May 11 '21

It didn't ask me to sign in to anything on web.

1

u/evan_0x Jun 20 '21

Hmm why this interim thing is hidden

1

u/critical_sense1 May 11 '21

Should be posted in todayILearned subreddit...LOL