Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: was python implemented as a object oriented langage at the beginning ?

0 views
Skip to first unread message

Fredrik Lundh

unread,
Oct 3, 2006, 8:24:25 AM10/3/06
to pytho...@python.org
Bertrand Ballis wrote:

> I heard a lot of people from the Ruby community claiming that Python, like
> Perl, was a scripting langage that was changed aftewards to be object
> compatible, and that was making it not as good as Ruby, object-oriented
> from the begenning.
>
> Is that true ?

nope.

</F>

MonkeeSage

unread,
Oct 3, 2006, 8:47:53 AM10/3/06
to

Sounds like a bunch of hooey on both counts ("alot of people claiming"
and "python not OO"). The python object system is closer to C++, ruby's
is closer to SmallTalk; but they are both OO (i.e., everything is an
object), and support all the OOP distinctives (i.e., encapsulation,
abstraction, &c) -- just because a language doesn't implement OO in the
exact same way as another doesn't mean it isn't OO -- it just means
it's a different language. Sounds like mabye you heard a few ruby
zealots who didn't know what they were talking about.

Regards,
Jordan

John Roth

unread,
Oct 3, 2006, 11:29:36 AM10/3/06
to

Since the original isn't showing up on Google Groups,
I'm going to hijack this response to make a longer
answer.

One problem with the frequently made assertion that
Ruby is "real" OO and Python isn't is that the person
making it usually doesn't say what they think "real"
OO is all about. It raises the suspicion that they're
repeating something they've heard without thinking
it through for themselves.

There are some significant differences. Python, like
C++, is multi-paradigm. That means that it's got
procedural elements such as the built-in functions.
Ruby doesn't: everything you can do is a method on
an object.

Another difference is that in Ruby, like Java,
everything descends from a single root object.
This is typical for a single inheritance language,
and not typical for a multiple inheritance language.
In Python all objects don't descend from a single
root object, although all new style classes do;
old style classes will vanish in release 3.0.

In Ruby, all objects are modifyable at runtime.
In Python many objects aren't, although most of
them can be subclassed. There is actually a
decent example of where this is useful: see the
rSpec language where they put a method named
"should" directly on object, for good reason.

John Roth

has

unread,
Oct 3, 2006, 6:13:14 PM10/3/06
to
MonkeeSage wrote:
> [...] just because a language doesn't implement OO in the

> exact same way as another doesn't mean it isn't OO -- it just means
> it's a different language.

I've a suspicion that folk who aren't familiar with the Python object
system automatically assume the phrase 'Python types' means
C++/Java-style primitives - which it doesn't. Python's type/class
distinction may be klunky and inelegant, but it's still OO.

Bruno Desthuilliers

unread,
Oct 4, 2006, 4:23:15 AM10/4/06
to
has wrote:
> Python's type/class
> distinction

Which "type/class" distinction ?


--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'on...@xiludom.gro'.split('@')])"

hanumizzle

unread,
Oct 6, 2006, 1:32:24 AM10/6/06
to Bruno Desthuilliers, pytho...@python.org
On 10/4/06, Bruno Desthuilliers <on...@xiludom.gro> wrote:
> has wrote:
> > Python's type/class
> > distinction
>
> Which "type/class" distinction ?

I think he means pre 2.2. (?)

0 new messages