New statement proposal for Python

D-Man dsh8290 at rit.edu
Thu Jun 14 14:20:52 EDT 2001


On Thu, Jun 14, 2001 at 04:19:08PM +0000, David LeBlanc wrote:
| One thing that bugs me about Python is that there's no really good way to 
| have named constants so that magic numbers can be avoided. Assigning to a 
| variable that (should) never changes is not the same (i.e. the "should 
| never" part).

I was just thinking that a class instance that overrides __setattr__
can provide the same thing.  I suppose use keyword arguments to
__init__ to provide the values, and all future assignments blow up.

-D





More information about the Python-list mailing list