python 类属性初始化

类的一个属性的多种可能初始化:

http://stackoverflow.com/questions/2164258/multiple-constructors-in-python

类多个属性的初始化:

http://stackoverflow.com/questions/5279855/python-class-with-many-attributes

 

class Foo(object):
    def __init__(self, a=None, b=None, c=None):
        self.a = a
        self.b = b
        self.c = c

posted on 2016-03-08 11:31  一动不动的葱头  阅读(808)  评论(0编辑  收藏  举报

导航