On 4/22/05, Fredrik Lundh firstname.lastname@example.org wrote:
Is there a document that details which objects are cached in memory (to not create the same object multiple times, for performance)?
why do you think you need to know?
I was in my second class of the Python workshop I'm giving here in one Argentine University, and I was explaining how to think using name/object and not variable/value.
Using id() for being pedagogic about the objects, the kids saw that id(3) was always the same, but id() not. I explained to them that Python, in some circumstances, caches the object, and I kept them happy enough.
But I really don't know what objects and in which circumstances.