+ 2
[Solved] Does a class need a def?
Say I have a superclass with a function (self, etc.), do the subclasses need to have a def (whatever) or can they be blank?
3 Antworten
+ 7
+ 5
All you need is something to go after the New class declaration or you will get IndentationError as the interpreter will expect some indented code. pass does just that - it does nothing but acts as a placeholder for the indented text block.
+ 1
Yeah, I guess like that. Thanks!