In a message of Sun, 19 Apr 2015 17:23:13 -0500, boB Stepp writes: >On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel <da...@davea.name> wrote: >> abstract, and the details are unimportant to the user. For example, the >> jython system does not use addresses at all. And an object gets moved >> around from time to time without its references knowing it. > >The last sentence in this paragraph has me intrigued. Why would an >object, once it has been created, be moved? What practical benefit >does doing this give? > >boB
One great reason is called 'garbage collection'. We find all the objects we are using, stuff them someplace in memory, and free up all the space they left. Now we are free to lay down a whole lot of other things, in contiguous order. When you want to go access an array, for instance, it matters' a whole lot if you can actually say: for x for y tell_me (x,y) rather than a lot of 'oops, I would love to tell you but when I went to an address I got told, out space, go look over hear instead. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor