New statement proposal for Python

Alex Martelli aleaxit at yahoo.com
Fri Jun 15 18:30:15 CEST 2001


"John Roth" <johnroth at ameritech.net> wrote in message
news:tik6mvpq92il0d at news.supernews.com...
    ...
> 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 const.name or alias.name
CAN easily be made unrebindable after an 'import const' or
'import alias'.  Again, see my post of yesterday on this thread.


Alex






More information about the Python-list mailing list