[Types-sig] What is the Essence of Python?

Edward Welbourne Edward Welbourne <eddyw@lsl.co.uk>
Thu, 16 Dec 1999 18:14:17 +0000


>>>> I reiterate that we should define what is the essence of Python,
>> ... like asking somebody to describe the color "blue" :-)
> I hope some of you will make an extra effort to help newbies like me!

The nearest you could hope to get to `what is the essence of Python'
would be if each of the folk in the present discussion ignored one
another's answers (and opinions) and told you our own individual answers,
but you mustn't go expecting our answers to agree ...

So ... what is the essence of Python ?  Eddy's answer:

A bunch of protocols for manipulating namespaces and functions.

An object is a namespace if getattr knows how to ask it for attributes.
Anything you want to do with a namespace, you do by:
  * finding the protocol that describes what you wanted to do
  * looking up the attributes the protocol specifies
  * calling the function (it usually is a function) you just got back,
    with the arguments the protocol specifies, and
  * trusting that this has either:
     - achieved the effect you had in mind, or
     - raised an exception (probably stipulated by the protocol)

There are a few handy built-in types and functions which suffice to
boot-strap the protocols python defines, and to let you do `most' of the
things you will ever want to do.  These suffice for implementation of
everything else you might want to do.  The base protocols are specified
in terms of various names, typically beginning and ending `__'.


Now, with any luck, other answers will be so different you'll doubt we
were talking about the same language as one another ... then you'll
begin to understand why, though your question is sensible, we can't give
you a sensible answer ;^>

	Eddy.