[Tutor] Alan Gauld Tutorial - OOP
alan.gauld at freenet.co.uk
Tue Apr 18 12:19:32 CEST 2006
> I am reading Alan's tut and have stuck on the OOP chapter.
> What does he mean by,
> | Objects are collections of data and functions that operate on that
> |data. These are bound together so that you can pass an object from one
> |part of your program and they automatically get access to not only the
> |data attributes but the operations that are available too.
> What are exactly "data attributes" and what "operations" is he referring
I mean the data and the functions that are used to create an object.
As the definition above states, objects are collections of data and
the functions that operate on the data. Another name for a function
inside an object is "operation", and as you'll discover the most
common name of all is "method"
Any time you see a word in italics in my tutor it means I'm introducing
a new technical term. Thus attributes and operations being italicised
tells you that these are jargon terms for the data and functions just
You have already met objects back in the Raw Materials topic and
also in strings and files. (Strings and Files are predefined objects in
Python) . The OOP topic tells you how to create your own object
types, or classes.
Author of the learn to program web tutor
More information about the Tutor