A simple class is bugging on a convention.

Started by
6 comments, last by Missle Launch 17 years, 10 months ago
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?
Advertisement
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.
http://rafb.net/paste/results/tnbZCP81.html

Same problem.
That's not how you create an instance of a class in Python.
Ah! Then how?
Quote:Original post by Missle Launch
Ah! Then how?


http://docs.python.org/tut/node11.html

-me
sonic = RunningSonic()

Doing sonic = RunningSonic simply makes sonic a value equivalent to the class object RunningSonic. Yes, classes themselves are objects in Python.
I figured it out, guys. Thanks for the link.

This topic is closed to new replies.

Advertisement