3 ms·
Just as a note, the way that Python stores the items isn't always 4 bytes per char, it depends on the actual string contents. I think that https://rushter.com/
by fabioz 4y ago
Just as a note, the way that Python stores the items isn't always 4 bytes per char, it depends on the actual string contents.
I think that https://rushter.com/blog/python-strings-and-memory/ https://rushter.com/blog/python-strings-and-memory/ is a nice reference on that.
- nerdponx 4y agoInteresting and good to know! CPython is really quite impressive with all of these little optimizations.