ANN: munepy 1.3 - yet another Python enumeration package

Barry Warsaw barry at python.org
Sat Jun 30 18:50:37 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm pleased to announce the release of munepy 1.3.  munepy is yet  
another Python enumeration package.  It is compatible with Python 2.4  
and 2.5.  It's not called 'enum' because that's already taken by an  
alternative enum package.  From the README.txt file:

Introduction
============

This package is called `munepy`.  It is yet another Python enum  
package, but
with a slightly different take on syntax and semantics than earlier such
packages.

The goals of munepy were to produce simple, specific, concise  
semantics in an
easy to read and write syntax.  munepy has just enough of the  
features needed
to make Enums useful, but without a lot of extra baggage to weigh  
them down.
This work grew out of the Mailman 3.0 project and it is the enum  
package used
there.

The name `munepy` is a play on words.  *mune* is *enum* backwards,  
and *py* is
a common suffix for Python code.  *munepy* is pronounced exactly the  
same as
the delicious round chocolaty (if appearance indicates) pastry Moon  
Pie, which
is best when consumed with an RC cola.

Why another Python enum implementation?  'Cause I like mine better. :)

Here's just a small example, from the documentation:

     >>> from munepy import Enum
     >>> class Colors(Enum):
     ...     red = 1
     ...     green = 2
     ...     blue = 3

     >>> print Colors.red
     Colors.red

     >>> Colors.red is Colors.red
     True
     >>> Colors.blue is Colors.blue
     True
     >>> Colors.red is not Colors.blue
     True
     >>> Colors.blue is Colors.red
     False

     >>> int(Colors.red)
     1
     >>> int(Colors.green)
     2
     >>> int(Colors.blue)
     3

Download the package from the Cheeseshop:

	http://cheeseshop.python.org/pypi/munepy

The source code is maintained under the Bazaar version control  
system.  You can access the code from here:

	https://code.launchpad.net/munepy/

The project home is here:

	https://launchpad.net/munepy/

Enjoy,
- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBRoaJ3nEjvBPtnXfVAQLOnwQAshlhRB9+xSCeSxST2Qvj5lOmxNrBaAdX
Q7KbnChJxcIajoKTv0eQhT1cyNDmLriLkE0D1Wpv5T47PyXi0Li1D/SXDUvyubN+
mGFAh5KvlhBCzC+lBh31xvoxrGaHQM+3KTn3BmoBaVovsw7xzEzlWx2foAR5HvOz
QjAZEkZFEA0=
=PQu2
-----END PGP SIGNATURE-----


More information about the Python-announce-list mailing list