is python Object oriented??
Laszlo Nagy
gandalf at shopzeus.com
Sat Jan 31 03:11:03 EST 2009
M Kumar wrote:
> Object oriented languages doesn't allow execution of the code without
> class objects, what is actually happening when we execute some piece
> of code, is it bound to any class?
> Those who have time and consideration can help me
There are many kinds of definitions for "object oriented" languages. I
have learned some things in the University, and one of them was making
distinction between "pure object oriented" languages, and "mixed" languages.
Pure object oriented languages does not have programming tools that are
non-objects. A good example was SmallTalk, if I remember correctly.
Python is not a pure object oriented language, because it has other
programming tools, for example functions.
However, your question seems to be pedantry. As others would say, "you
can do programming in FORTRAN in any language". In other words, it is
possible to use Python in a non object-oriented way, but the "good" way
of using it is defining classes and making objects... So Python *is*
object oriented, if you use it the right way. There might be a
definition of "object oriented language" that does not apply to Python,
and theoretically, you could say that according to that definition,
Python is not object oriented. But practically, it is!
Best,
Laszlo
More information about the Python-list
mailing list