A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/105929.html below:

[Python-Dev] constant/enum type in stdlib

[Python-Dev] constant/enum type in stdlib [Python-Dev] constant/enum type in stdlibGreg Ewing greg.ewing at canterbury.ac.nz
Tue Nov 23 22:26:58 CET 2010
Antoine Pitrou wrote:

> I don't understand why people insist on calling that an "enum". enum is
> a C legacy and it doesn't bring anything useful as I can tell.

The usefulness is that they can have a str() or repr() that
displays the name of the value instead of an integer.

The bool type was added for much the same reason -- otherwise
we would simply have gotten builtin names False = 0 and
True = 1.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4