Dnia Wed, 22 Jun 2011 22:17:49 +0100, Noah Hall napisaĆ(a): > On Wed, Jun 22, 2011 at 7:54 PM, sidRo <slacky2...@gmail.com> wrote: >> How to declare a constant in python 3? > > There aren't true constants in Python, but instead we use a standard > defined by PEP 8, which states constants are in all caps, for example, > PI = 3.14, as opposed to pi = 3.14 which could change (according to > PEP 8, that is)
That said, there are some workarounds for that: http://code.activestate.com/recipes/65207-constants-in-python/?in=user-97991 Still, I'd reallly like to have constants as a built-in... Best regards, Waldek -- http://mail.python.org/mailman/listinfo/python-list