New statement proposal for Python

John Roth johnroth at
Fri Jun 15 10:24:17 EDT 2001

"Nick Perkins" <nperkins7 at> wrote in message
news:nQeW6.237411$eK2.50576177 at
> "David LeBlanc" <whisper at oz.nospamnet> wrote in message
> news:9gbsdv$8ft$9 at
> > alias true: 1
> ...
> > so nicely to be able to say "if something is true"
> it's even easier than that:
> if something:
>     ...
> ..which can 'read' just as well, if you choose your names accordingly.
> ..but on a more general note, am i to understand that you are suggesting
> C-style macros, where code is 'physically substituted', before being run?
> That would be a Bad Thing, i think.   C was a nice little language before
> turned into a giant mess of macro substitutions.

I didn't understand David's proposal as macro preprocessing. I understood it
as a request for a one-time assignment (i.e., one that guaranteed that the
couldn't be reassigned (or rebound to a different object, for language

As far as I'm concerned, that's the essence of the proposal: whatever object
bound to the name will not change (at least, until the code is edited!) This
that it really only makes sense for immutable objects.

I also don't really care about the syntax - there are people working on
who are much more knowledagable about what would fit cleanly. I prefer
but I could live quite happily with "alias." Likewise, I prefer "=", since
vision is that it really is a (one-time) assignment, but I could live with

The run-time issue (how to make it happen) could be fairly messy - I don't
of any mechanism currently in Python that will prevent a name from being
to another object.

The problems with the C language #define statement are outside of the
scope of this discussion, other than as a horrible example of how to add a
of obfustication to a program.

John Roth

More information about the Python-list mailing list