About 120,000 results
Open links in new tab
  1. String Interning in Python - GeeksforGeeks

    Feb 22, 2024 · Understanding string interning in Python is crucial for optimizing memory usage and improving the performance of string operations. By recognizing scenarios where interning …

  2. What does sys.intern() do and when should it be used?

    Oct 17, 2020 · The sys.intern function maintains a table of interned strings. When you attempt to intern a string, the function looks it up in the table and: If the string does not exists (hasn't …

  3. Guide to String Interning in Python - Stack Abuse

    Oct 5, 2020 · In this article, we'll dive into the concept of String Interning in Python. With examples and theory, we'll explain how it works and what benefits it brings to everyday tasks.

  4. Python string interning - Stack Overflow

    Mar 21, 2013 · source = ( 's1 = "string"\n' 's2 = "strin" + "g"\n' 's3a = "strin"\n' 's3 = s3a + "g"') code = compile(source, '', 'exec') print(dis.dis(code)) If you were to manually sys.intern() the result of …

  5. Understanding Python's String Interning | Medium

    Jul 15, 2024 · Learn how Python's string interning optimizes memory and improves performance by storing only one copy of identical strings. Discover when and how it occurs.

  6. How Python Uses String Interning to Keep Runtime Efficient

    String Interning is a compiler/interpreter optimization method that makes common string processing tasks space and time efficient by caching them.

  7. A Comprehensive Guide to String Interning in Python

    Mar 3, 2025 · String interning is an essential concept in Python that contributes to memory efficiency, particularly with immutable strings. By utilizing the sys.intern() function, developers …

  8. Python’s String Pool & Interning — The Memory optimization

    It’s not magic — it’s String Interning, a powerful memory optimization technique that Python uses under the hood. In this blog, we’ll uncover what the String Pool is, how Interning works, and...

  9. String Interning in Python: A Hidden Gem That Makes Your …

    May 10, 2021 · The string interning is a very helpful mechanism in Python to make string comparisons much faster. Unfortunately, how it works and how to use it properly are not very …

  10. Understanding Python String Interning in Python 3 Programming

    Feb 23, 2024 · String interning is the process of reusing immutable strings by storing them in a string pool or cache. In Python, string interning is performed automatically for string literals and …

  11. Some results have been removed
Refresh