Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Regarding Python is scripting language or not

Reply
Thread Tools

Re: Regarding Python is scripting language or not

 
 
Terry Reedy
Guest
Posts: n/a
 
      06-17-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


 
Reply With Quote
 
 
 
 
Asun Friere
Guest
Posts: n/a
 
      06-18-2009
On Jun 18, 5:03*am, Terry Reedy <(E-Mail Removed)> wrote:

> 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*!


+1

This needs to be said to those who imagine, because you have to code
the class explicitly in Java whereas Python objects can be manipulated
in ignorance of the idea of class, that Java is somehow OO in the way
Python is not.

OTOH the whole notion of defining OO by the use of classes
automatically excludes from consideration prototype-based OO languages
(eg. Self) which arguably offer a purer approach to OO than class
centric languages.




 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      06-18-2009
Asun Friere a écrit :
(snip)

> OTOH the whole notion of defining OO by the use of classes
> automatically excludes from consideration prototype-based OO languages
> (eg. Self) which arguably offer a purer approach to OO than class
> centric languages.


FWIW, there's no notion of "class" in the minimal (and only commonly
agreed AFAIK) definitions of OO:

1/ an object id defined by an id, a state and a behaviour
2/ objects communicate by sending messages to each others
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Regarding Python is scripting language or not Jean-Michel Pichavant Python 3 06-18-2009 06:44 AM
Using a Scripting Language as Your Scripting Language DaveInSidney Python 0 05-09-2005 03:13 AM
limited python virtual machine (WAS: Another scripting language implementedinto Python itself?) Steven Bethard Python 29 01-30-2005 08:30 PM
Python is the best and most popular general purpose scripting language; the universal scripting language Ron Stephens Python 23 04-12-2004 05:32 PM
Implementing a scripting language in Python Gabriele Farina Python 3 10-31-2003 06:12 PM



Advertisments