Change in behaviour Python 3.7 > 3.8

Serhiy Storchaka storchaka at gmail.com
Fri Feb 7 03:44:56 EST 2020


07.02.20 07:27, Frank Millman пише:
> @Serhiy
> I import the common object *from* Module A.

Sorry, I incorrectly described the change made in issue33331. Even if 
you import it from module A, you can see that it was set to None at the 
time of executing __del__. But you could see this even before 
issue33331. It was just your luck that you did not fail before.

The robust way of solving such issues is to keep a reference to all 
objects used in __del__:

     def __del__(self, common_object=common_object):
         ...



More information about the Python-list mailing list