[Python-Dev] Re: [Types-sig] namespaces (was: Changing existing class instances)

Paul Prescod paul@prescod.net
Fri, 21 Jan 2000 08:51:24 -0800


Greg Stein wrote:
> Tim Peters:
> > Trying to overload the current namespace set makes it so
> > much harder to see that these are compile-time gimmicks, and users need to
> > be acutely aware of that if they're to use it effectively.  Note that I
> > understand (& wholly agree with) the need for runtime introspection.
> 
> And that is the crux of the issue: I think the names that are assigned to
> these classes, interfaces, typedefs, or whatever, can follow the standard
> Python semantics and be plopped into the appropriate namespace. There is
> no overloading.

This is indeed the crux of the issue. For those that missed it last
time, it became very clear to me that we are working with radically
different design aesthetics when we discussed the idea of having an
optional keyword that said: "this thing is usually handled at compile
time but I want to handle it at runtime. I know what I am doing." 

Greg complained that that would require the programmer to understand too
much what was being done at compile time and what at runtime and what.
>From my point of view this is *exactly* what a programmer *needs* to
know and if we make it too hard for them to know it then we have failed.

> There is no "overloading" of namespaces. We are using Python namespaces
> just like they should be, and the type-checker doesn't even have to be all
> the smart to track this stuff.

There is an overloading of namespaces because we will separately specify
the *compile time semantics* of these names. We need to separately
specify these semantics because we need all compile time type checkers
to behave identically.

Yes, it seems elegant to make type objects seem as if they are "just
like" Python objects. Unfortunately they aren't. Type objects are
evaluated -- and accepted or rejected -- at compile time. Every
programmer needs to understand that and it should be blatantly obvious
in the syntax, just as everything else in Python syntax is blatantly
obvious.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Earth will soon support only survivor species -- dandelions, roaches, 
lizards, thistles, crows, rats. Not to mention 10 billion humans.
	- Planet of the Weeds, Harper's Magazine, October 1998