TypeError: __init__() takes exactly 1 argument (3 given) pyXML

末鹿安然 提交于 2019-12-01 19:41:46

You've got too many _ in the name of __init__. The declaration of your constructor should be:

def __init__(self, title, number):

not:

def __init___(self, title, number):

You have a typo - there's 3 underscores here:

def __init___(self, title, number):

Should be:

def __init__(self, title, number):

Because it doesn't exactly match the name __init__, Python only knows about the default constructor, def __init__(self).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!