PyNotes
261 subscribers
125 photos
7 videos
1 file
60 links
**Code is communication**
admin: @Xojarbu
https://t.me/solutions_py for problem solutions
Download Telegram
#memory_management
Title: String interning
To alleviate memory that can be quickly consumed by strings, Python implements string interning
— A string will be interned if it is a compile-time constant, is not the production of constant folding or is not longer than 20 characters, and consists exclusively of ASCII letters, digits, or underscores.
—Empty strings are interned.
Source
#memory_management
Title:
Integer Caching in Python

The Python implementation front loads an array of integers between -5 to 256. Hence, variables referring to an integer within the range would be pointing to the same object that already exists in memory

Source
#memory_management
The Tricky Case with Operators 😃

Source