+ 1
whats wrong in this code
class myfunc(list): pass When I execute the above code on repl I get : Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: list() takes at most 1 argument (3 given)
4 Réponses
+ 12
Try avoiding naming variables and method arguments with already meaningful names like restricted keywords or datatypes.
list() is a built-in datatype, that confuses Python interpreter.
+ 6
Please link your code from the playground.
+ 2
the 2 lines you provided don't throw that error on my ide.. need to see the part of your code where you call this.
0
thank you everyone..!!
I was confused as the 2 lines of code execute fine on an online browser repl (https://repl.it/languages/python3)
but on python3.5 installed on my system - it errors out.
So wanted to know why it errors out on my system.