Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您有很多相同字符串的副本浮动, Python 的intern函数可以通过将它们全部替换为对单个对象的引用来节省内存。
intern
我有类似的情况,除了我处理的是longs 而不是字符串。
long
有没有办法用 s 做类似的事情long?