Odd behavior with imp.reload and logging

Andrew Berg bahamutzero8825 at gmail.com
Thu Sep 22 05:02:48 EDT 2011


On 2011.09.22 03:25 AM, Steven D'Aprano wrote:
> Objects left lying around from before the reload will keep references 
> open to the way things were before the reload. This often leads to 
> confusion when modules are edited, then reloaded. (Been there, done that.)
I'll keep that in mind. My module does have a class, but instances are
kept inside dictionaries, which are explicitly set to {} at the
beginning (can't use the update() method for dictionaries that don't
exist). Also, class instances get pickled after creation and unpickled
when the module is imported.

-- 
CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 6.0.2



More information about the Python-list mailing list