[Python-Dev] copy, len and the like as 'object' methods?

David Ascher DavidA@ActiveState.com
Wed, 22 Aug 2001 20:45:07 -0700

Guido van Rossum wrote:
> > Actually, I couldn't care less about #1 or #2.  Paul and I hold our own
> > against Perl folks every day =), and I'm not a fan of pure-OO'ness.  I
> > do try to make _learning_ Python as easy as possible, and
> > inconsistencies such as this one do get in the way.
> This one seems to be something that you stumble over once, and then
> get used to.

I don't disagree, but people have said the same thing about
case-sensitivity, integer division, and Perl. =)

> > People who learn the language ask things like "how do I make a copy of
> > something?" and the answer to that is currently quite complicated.  It
> > just gets in the way, and it wastes synapses.
> Maybe they are asking the wrong question.  I think that copying isn't
> all that important in Python -- that's why it's in a module.

I'm tired of this argument, so I'll quit.  I'll just say that IMO
students can't ask the wrong questions.  The body of knowledge that they
bring to the table is perfectly valid.  They're trying to 'grok' a large
complicated system, and the questions they ask reflect steps in
understanding.  FWIW, I only talk about copying after I've discussed
references in depth, since that makes the argument you mention more
convincing.  I only half buy the argument myself, however, since the
elegance of the presentation is always marred by having to explain such
oddities, no matter how smoothly I finagle it.

I see much of Python's recent evolution as getting rid of wrinkles in
the system.  I just pointed out a wrinkle, that's all.  Note that I
started with a question, and I'll accept that you don't want to change

Next topic.