New statement proposal for Python

Alex Martelli aleaxit at
Fri Jun 15 12:30:15 EDT 2001

"John Roth" <johnroth at> wrote in message
news:tik6mvpq92il0d at
> The run-time issue (how to make it happen) could be fairly messy - I don't
> know
> of any mechanism currently in Python that will prevent a name from being
> rebound to another object.

__setattr__ of course.  It only works for an instance, but that
just means the 'module' called const (or alias, or whatever) has
to be an instance -- easy, as I already showed.  If as you say
you're not hung on the syntax, either or
CAN easily be made unrebindable after an 'import const' or
'import alias'.  Again, see my post of yesterday on this thread.


More information about the Python-list mailing list