Re: Regarding Python is scripting language or not

Discussion in 'Python' started by Terry Reedy, Jun 17, 2009.

  1. Terry Reedy

    Terry Reedy Guest

    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
     
    Terry Reedy, Jun 17, 2009
    #1
    1. Advertising

  2. Terry Reedy

    Asun Friere Guest

    On Jun 18, 5:03 am, Terry Reedy <> 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.
     
    Asun Friere, Jun 18, 2009
    #2
    1. Advertising

  3. 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
     
    Bruno Desthuilliers, Jun 18, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Stephens
    Replies:
    23
    Views:
    3,028
    Ron Stephens
    Apr 12, 2004
  2. Steven Bethard
    Replies:
    29
    Views:
    755
    Nick Craig-Wood
    Jan 30, 2005
  3. DaveInSidney
    Replies:
    0
    Views:
    461
    DaveInSidney
    May 9, 2005
  4. Replies:
    0
    Views:
    377
  5. Jean-Michel Pichavant

    Re: Regarding Python is scripting language or not

    Jean-Michel Pichavant, Jun 17, 2009, in forum: Python
    Replies:
    3
    Views:
    304
    Aaron Brady
    Jun 18, 2009
Loading...

Share This Page