No Thoughts about Everything

Josiah Carlson jcarlson at nospam.uci.edu
Wed Feb 25 17:32:02 EST 2004


> This will create c as an unmodifiable attribute:
> 
>     c = property(lambda self: 2.99792458e8)
> 
> 
> Does that do what you want?

 >>> class foo:
...     c = property(lambda self: 2.99792458e8)
...
 >>> v = foo()
 >>> v.c
299792458.0
 >>> v.c += 1
 >>> v.c
299792459.0
 >>> foo().c
299792458.0
 >>>

It doesn't quite work.

  - Josiah



More information about the Python-list mailing list