From: https://blog.csdn.net/cs0301lm/article/details/6002504?utm_source=blogxgwz4 [ 先贴参考书籍原文(中文英文对照)] __init__方法介绍:If a base class has an __init__() method the derived class's __init__() method must explicitly call it to ensure proper initialization…
#! /usr/bin/python # Filename:objvar.py class Person: '''Represents a person.''' population = 0 def __init__(self, name): ''' Initializes the person's data. ''' self.name = name print '(Initializeing %s)' % self.name # When this person is created, he…