finalizer

Why isn't the __del__ method called?

Why isn't the __del__ method called? Question: In python3’s multiprocess, can’t call the __del__ method. I’ve read other issues about circular references,but I can’t find the situation in multiprocess. There is a circular reference in foo, __del__ will be called when foo is called directly,but in multiprocess the __del__ will never be called. import multiprocessing …

Total answers: 2

Can a simple difference in Python3 variable names alter the way code runs?

Can a simple difference in Python3 variable names alter the way code runs? Question: This code… class Person: num_of_people = 0 def __init__(self, name): self.name = name Person.num_of_people += 1 def __del__(self): Person.num_of_people -= 1 def __str__(self): return ‘Hello, my name is ‘ + self.name cb = Person(‘Corey’) kb = Person(‘Katie’) v = Person(‘Val’) Produces …

Total answers: 1