In python, the initializer method is named __init__
, not _init_
(two underscores instead of one). So the method definition
def _init_(self, lyrics):
just defines an ordinary method, instead of overriding object.__init__
. Therefore, when you initialize the class with an argument, object.__init__(['Happy birthday...'])
gets called, and that fails.
To fix this problem, write __init__
with 2 underscores at each side (4 total):
def __init__(self, lyrics):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…