Regarding Python is scripting language or not

Terry Reedy tjreedy at udel.edu
Wed Jun 17 21:03:12 CEST 2009


Jochen Schulz wrote:
> abhishek goswami:
>> Can anyone Guide me that Python is Oject oriented programming language
>> or Script language
> 
> In my opinion, Python is both. But an "objective" answer would require
> you to define what you means by these terms.
> 
> If, by "object-oriented" you mean "everything has to be put into
> classes", then Python is not object-oriented.

That depends on what you mean by 'put into classes' (and 'everything').

If you mean 'be an instance of a class', which I think is the most 
natural reading, then Python *is* object-oriented and, if I understand 
what I have read correctly (so that ints are just (unboxed) ints and not 
members of an int class), Java *is not*!

If you mean 'be an attribute of a class' (which to me is not 'in') or 
textually located within a class statement, then I doubt an language 
qualifies. It is impossible for every class statement to lie within a 
class statement and I wonder whether any language requires all classes 
to be attributes of some class (as opposed to subclasses or instances).

However, if 'everything' means 'everything but classes', then, as I 
understand, Java and some others qualify.

If fact, if one views modules as classes that cannot be instanced or as 
classes with one instance, themselves, then Python also qualifies.

Python also qualifies if you mean 'be in some attribute of a class' and 
view modules as classes.  *All* modules are values of sys.modules, 
including builtins, __main__, and sys itself.

 > If, by "scripting
> language" you mean Python is an error-prone toy language, unsuitable for
> large, serious projects, then Python is not a scripting language either.

On the other hand, CPython is designed to be extended by and thereby 
script code written in C and C-wrapped Fortran. This is a big part of 
why it uses reference-counting for garbage collection.  It also has 
functions for running other processes and interacting with other processes.

Terry Jan Reedy





More information about the Python-list mailing list