"Blaise Morose" <[EMAIL PROTECTED]> wrote
I have this silly piece of code that I am experimenting with:
I'm not certain but... based on this quote from the Python docs:
--
Warning: Due to the precarious circumstances under which __del__()
methods are invoked, exceptions that occur during
There is no remaining referent to your class at the point when the
last instance has started to be deleted. This allows the class itself
to be garbage collected. Changing the code to the following will
prevent this.
#!/usr/bin/python
class Person:
population = 0
def __init__(self
> class Person:
> population = 0
>
> def __init__(self, name):
> self.name = name
> print '%s has been added' %self.name
> Person.population += 1
>
> def __del__(self):
> print '%s is leaving' % self.name
>
Hi,
I have this silly piece of code that I am experimenting with:
#!/usr/bin/python
class Person:
population = 0
def __init__(self, name):
self.name = name
print '%s has been added' %self.name
Person.population += 1
def _