Object Oriented Support

Python's object oriented features are simple and clean, just like the rest of the language.

To create a class:
class exampleClass:
     statement1
     statement2
    
To create a class that inherits from another:
class exampleClass2(exampleClass):
     extension1
     overide1
    
Multiple inheritance is supported.

To create an instance of a class:

instance = exampleClass()
    

Python is similar to Small Talk in that they both have the notions of class and instance side methods.

An instance side method is declared as:

class example2:
     def function(self, arg1, arg2)
    
where self will refer to the object being called upon during execution. When calling an instance method you do not give a value for the first argument, it is given its value automatically.
Prev Contents Next
Clinton Roy