How do you create constants?

Alex Martelli aleaxit at yahoo.com
Mon Nov 6 08:31:11 EST 2000


"Andy Heath" <andyheath at linuxstart.com> wrote in message
news:mailman.973101545.6786.python-list at python.org...
> If you want constants what is wrong with creating functions
> with those values
>
> eg.
>
> def pi():
>     return 3.142

What's the added value of their being 'functions', to
pay for the little hassle of having to remember the
trailing-() and the little extra overhead?  They'll be
just as rebindable as any other variable/attribute...


Alex






More information about the Python-list mailing list