python 3 constant

Ben Finney ben+python at benfinney.id.au
Thu Jun 23 03:22:37 EDT 2011


"Waldek M." <wm at localhost.localdomain> writes:

> Still, I'd reallly like to have constants as a built-in...

If you mean creating a binding which can't be re-bound: −1.

The ability to re-bind any attribute, even ones which the author thought
should be constant, makes writing unit tests much easier. I don't see
that putative benefits of constant bindings would be anywhere near as
valuable.

-- 
 \       “I love and treasure individuals as I meet them, I loathe and |
  `\     despise the groups they identify with and belong to.” —George |
_o__)                                                     Carlin, 2007 |
Ben Finney



More information about the Python-list mailing list