What are modules really for?

Terry Reedy tjreedy at udel.edu
Sat Aug 13 09:30:31 EDT 2005


"Mike Meyer" <mwm at mired.org> wrote in message 
news:86r7cy63wi.fsf at bhuda.mired.org...
> Magnus Lycka <lycka at carmen.se> writes:

>> Terry Reedy wrote:
>>> However, everything is an instance of a class or type.

>> Except whitespace, comments, operators and statements!
>> (Did I miss anything?)

> [snip] Maybe the properly
> refined version of Terry's statement should be:
>
>        Everything you can manipulate is an instance of a class or a
>        type.

Yes and no.

First, the context of the statement was a previous claim that some things 
are class instances and some not.   So my point in that context was a) that 
adding 'or type' changes 'some' to 'every' and that new classes mostly 
eliminate the difference between class and type, making the addition 
eminently sensible.  So while I thought of a qualifier like that, I left it 
out as irrelevant and a distractions.

Second, any qualifier I can think of seems to have the danger of confusing 
as well as enlightening.  One might not realize, for instance, that 
functions are something you can manipulate and might therefore mistakenly 
think that the qualifier excludes functions.  I also thought of putting it 
as 'everything in Python's dataspace ...', but that has the same problem.

Perhaps 'every runtime entity...'. would work. That seems to excludes 
source code (and things within source code like comments and whitespace and 
operator symbols), unless the code or pieces thereof *are* turned into (or 
wrapped as) string instances.  Names might seem like an exception, but 
again, they are only accessible at runtime as string instances.  Or maybe a 
more direct statement 'except for source code, everything...' would be 
better.

So I have so far not settled on a 'best' context-free statement of the 
design principle.

Terry J. Reedy






More information about the Python-list mailing list