On Tue, Jul 13, 2010 at 9:00 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > Making sure both __main__ and the corresponding importable name refers > to the same module object seems reasonable.
One detail that may not have been obvious when I described the persistent object problem; when class references are pickled, they should be for the "real" name of the module, not __main__. Loading the file as __main__ and adding an alias in sys.modules simply isn't sufficient. Existing instances could be loaded, but new instances would cause references to the classes defined in __main__. To some degree, this sort of problem can be easily handled using a "don't do that" approach, and this isn't likely to burn someone just learning Python on the first day. (Well, maybe in the afternoon, once they've got the basics down.) -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "A storm broke loose in my mind." --Albert Einstein _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com