New statement proposal for Python

Nick Perkins nperkins7 at home.com
Thu Jun 14 22:18:14 EDT 2001


..nicely done, Alex!

..but what is your opinion as to whether this functionality belongs in the
language itself?
Those coming from other languages are likely to expect to have constant
values of some sort.

Your solution looks great, but still you have to type "const.foo" instead of
just "foo".
How much run-time overhead does this involve?  I suppose only a tiny amount,
and perhaps no more than even a 'language-level' implementation would have,
but I think I would probably not use this in my most-inner loops.

I suppose one could always bind a local name to the value..
width = const.width
..but then 'width' is no longer constant, and can be changed at will.







More information about the Python-list mailing list