Encapsulation, inheritance and polymorphism

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Tue Jul 17 11:30:42 CEST 2012


Welcome!

Am 17.07.2012 10:45, schrieb Lipska the Kat:
> I was expecting (hoping) to see in depth documentation relating to Class
> construction, extension mechanisms and runtime polymorphism.

In addition to this forum for direct help and discussion, two 
suggestions: Firstly, it could help if you mentioned what programming 
languages you are fluent in, in order to help traditional misconceptions 
and to draw parallels. Secondly, http://docs.python.org is the central 
hub to tutorials and documentation.


> What I actually get is a confusion of Classes, modules, scripts and
> whatever else.

Due to the very dynamic nature of Python, types (classes), modules and 
functions are themselves objects that can be manipulated.


> Is Python truly OO or is it just one way to use the language.

Python supports OOP, but it doesn't enforce it. You can use other 
paradigms, too.


> I see some documentation relating to classes but nothing on
> instantiation .. in fact the documentation appears to say that classes
 > are used in a static way e.g ClassName.method(), and command line
 > scripting is really outside the scope of other OO languages I have
 > experienced.

I think you are confused. For the documentation, it would help to know 
which documentation exactly seems to make such claims. For the thing 
about commandline scripting, I'm afraid you will have to adjust your 
expectations.

BTW: In general, you instantiate a class by just calling the class' name 
like a function. If e.g. ClassName is a class, ClassName() instantiates 
this class.


Good luck!

Uli



More information about the Python-list mailing list