A simple class is bugging on a convention.
http://rafb.net/paste/results/vDUuiS17.html
http://img414.imageshack.us/img414/4462/sonicgen19jp.th.gif
I'm told I need to supply an instance of RunningSonic as the first argument. Isn't that made automatically? How is this thing broken?
You never made an object of class RunningSonic. You just made the class. Similarly, you can eat an apple, but you cannot eat the concept of an apple. That's what a class is: a concept of a kind of object.
sonic = RunningSonic()
Doing sonic = RunningSonic simply makes sonic a value equivalent to the class object RunningSonic. Yes, classes themselves are objects in Python.
Doing sonic = RunningSonic simply makes sonic a value equivalent to the class object RunningSonic. Yes, classes themselves are objects in Python.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement