Objects in Python

lipska the kat lipskathekat at yahoo.co.uk
Wed Aug 22 10:59:25 EDT 2012


On 22/08/12 15:13, shaun wrote:

[snip]

> Im very new to python and the object orientated feature doesnt seem to be as well put together as Java. Can anyone help with this problem?

 From one Java head to another I suggest you park what you know about 
Java and approach Python with a clear mind.

Python is not Java and Java is not Python, that much has become clear.
Python has actually been around longer than Java and contains many 
features you will be familiar with, serialization and introspection to 
name but two. The whole 'everything is an object' thing is a bit strange 
at first but actually it just means that everything you write is wrapped 
up in a component that exposes various standard methods and attributes, 
you treat functions as Objects and modules as Objects and even your 
classes will automagically sprout new attributes and properties, at 
least that's what I've discovered so far.

There is no real enforced concept of information hiding, no binding of 
type to variable in fact no concept of typing at all as far as I can 
see. No interfaces and no subtype polymorphism (Python has 'Duck Type' 
polymorphism and I haven't really explored all the ramifications of this 
yet). It does however have multiple inheritance.

In trying to get a handle on the language it has helped me to think of 
Python as a friendly interface onto the C programming language, it may 
or may not help you

There are some very experienced pythonistas here and I'm sure you will 
get the help you need. There is a tutor mailing list and a great first 
starter is Dive into Python (google it)

I can't say that Python will replace Java for me, I've been using Java 
since version 1, but it's got a good standard library and good support 
here and on the mailing list ... and it supports Unicode :-)

I like it, give it a chance and you will probably like it too.

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun



More information about the Python-list mailing list