On 6/22/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> This hypothetical "const" would be a *statement*,
> executed like any other statement.  It binds a name to a value -- and
> produces an error if the value changes.  The compiler doesn't need to know
> what it evaluates to at runtime; that's what LOAD_NAME or LOAD_DEREF are
> for.  ;)

Please think this through more. How do you implement the "produces an
error if the value changes" part? Is the const property you're
thinking of part of the name or of the object it refers to?

The only way I can see it work is if const-ness is a compile-time
property of names, just like global. But that requires too much
repetition when a constant is imported.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to