Thanks for the feedback, everyone. I spent some time today playing around with the gc module, and came to the same conclusion that many of you have as well.

for o in gc.get_objects():
        print(o)

 was sufficient to convince me that I didn't want to go that route.

Writing a simple memory pool/heap that students will have to use to allocate/deallocate objects of a particular type definitely seems the way to go. It will get the ideas across, and allow them to contrast the garbage collection and explicit memory management paradigms.

-Daniel
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to