Sign in to follow this  
colts18

Instances

Recommended Posts

SimonForsman    7642
[url="http://docs.python.org/tutorial/classes.html"]http://docs.python.o...al/classes.html[/url]

Basically an instance is an object created from a class

i.e x = MyClass()

to use it you just add x. before the name of the member variable or method you want to use.

if the MyClass class has a member function/method called doSomething() for example you can run that function on the x instance by typing x.doSomething()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this