Wanggcong

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

分类:

技术点:

相关文章:

  • 2021-08-06
  • 2021-11-04
  • 2022-12-23
  • 2021-12-08
  • 2021-12-10
  • 2021-09-27
  • 2021-11-14
  • 2022-02-18
猜你喜欢
  • 2021-12-10
  • 2021-11-20
  • 2021-11-18
  • 2021-11-19
  • 2021-10-02
  • 2022-02-09
  • 2021-11-28
相关资源
相似解决方案