TypeError:object()不带参数python

时间:2017-11-09 05:19:32

标签: python-3.x

我是python的新手我收到这样的错误

Traceback (most recent call last):
  File "D:/learn/ClassAttributes/MutabilityofClassAttributes.py", line 7, in <module>
    s1 = Service(['a', 'b'])
TypeError: object() takes no parameters

代码在那里谢谢!

 class Service(object):
     data = []

     def __int__(self, other_data):
         self.other_data = other_data

 s1 = Service(['a', 'b'])
 s2 = Service(['c', 'd'])

0 个答案:

没有答案