is python Object oriented??

Chris Rebert clp2 at rebertia.com
Thu Jan 29 11:25:57 CET 2009


On Thu, Jan 29, 2009 at 2:01 AM, M Kumar <tomanishkb at gmail.com> 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?

That's not really the standard definition of object-oriented (c.f.
Wikipedia), but by your definition (which seems Java/Ruby-centric,
IMHO), Python would not be object-oriented.

In addition to methods, Python has functions, which are not associated
with a class and let you write code in a procedural style, thus
failing your criterion.
Python also has the top-level module scope, in which the code isn't
even part of a method or function at all and thus certainly is not
associated with a class, again not satisfying your criterion.

Cheers,
Chris
-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list