constant in python?

Brian Quinlan BrianQ at ActiveState.com
Fri Aug 17 22:12:18 CEST 2001


> is there a data type like the const in c/c++? ive been
> combing through the doc and it doesnt seem to have one
> or am i missing something somewhere?

No such thing exists. Just set a variable with the value that you want
and don't change it. If you really need a constant (which you almost
certainly don't), you can use the cookbook example:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/59878

Cheers,
Brian





More information about the Python-list mailing list