[Python-ideas] constant/enum type in stdlib

Joao S. O. Bueno jsbueno at python.org.br
Tue Jan 29 02:50:45 CET 2013


This idea is not new - but it is stalled  -
Last I remember it came around in Python-devel in 2010, in this thread:
http://mail.python.org/pipermail/python-dev/2010-November/thread.html#105967

There is an even older PEP (PEP 354)  that was rejected just for not
being enough interest at the time -

And it was not dismissed at all - to the contrary the last e-mail in the thread
is a message from the BDLF for it to **be** ! The discussion  happened in a bad
moment as Python was mostly freature froozen for 3.2 - and it did not
show up again for Python 3.3;

The reasoning for wanting enums/ constants has been debated already -
but one of the main reasons that emerge from that thread are the ability to have
named constants (just like we have "True" and "False".

why do I think this is needed in the stdlib, and having itin a 3rd
party module is not enough? because they are an interesting thing to have,
 not only on the stdlib, but on several widely used Python projects that
 don't have other dependencies.
Having a feature like this into the stdlib allow these projects to
make use of it, without needing other dependencies, and moreover,
users which will
benefit the most out of such constants will have a wll known
"constant" type which
won't come as a surprise in each package he is using interactively or debugging.

Most of the discussion on the 2010 thread was summed up in a message by
Michael Foord in this link
http://mail.python.org/pipermail/python-dev/2010-November/106063.html
with some follow up here:
http://mail.python.org/pipermail/python-dev/2010-November/106065.html



  js
 -><-
----------

--



More information about the Python-ideas mailing list