[请教]映射list为何会影响不相关的类

[请教]映射list为何会影响不相关的类

初学python,写了如下代码,但是运行过程中抛出异常:
import sys,os
import random

class Person:
    population = 0
    def __init__(self, name):
        self.name = name
        erson.population += 1
    def __del__(self):
        print "%s says goodbye" %self.name
        erson.population -= 1
        
    def print_name(self):
        print "population=", Person.population, ", name=", self.name
        
p = Person("aaronpan")
p.print_name()

p2 = Person("yangyan")
p2.print_name()

randnum = []
for index in range(0,100):
    randnum.append(random.randint(0, 99))
 
print "len(randnum)= ", len(randnum)
randnum.sort()

num_count = [0 for i in range(0, 100)]     #注释1

#for item in randnum:
#    num_count[item] += 1
    
#print num_count

#alias_person = Person
p3 = Person("new_s")
#print type(Person)
#print type(alias_person)
p3.print_name()

p4 = Person("delete")
p4.print_name()

异常如下:
population= 1 , name= aaronpan
population= 2 , name= yangyan
len(randnum)=  100
population= 3 , name= new_s
population= 4 , name= delete
yangyan says goodbye
delete says goodbye
aaronpan says goodbye
new_s says goodbye
Exception exceptions.AttributeError: "'NoneType' object has no attribute 'population'" in <bound method Person.__del__ of <__main__.Person instance at 0x00B538C8>> ignored
如果将“注释1”行代码注释掉,或将p3,p4两个对象放在“注释1”行的前面,则不抛异常

哪位能帮我解释一下啊?
我这儿跑的没有异常
可能是解释器的原因,这个__del__是解释器调的,在程序要退出的时候,C++这样写没啥问题,python就不一定了,如果你__del__里只是输出名字,没有变量的引用的话,是没问题的。