Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #2125

[ANN] Aenum 1.4.1

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ethan Furman <ethan@stoneleaf.us>
Newsgroups comp.lang.python.announce
Subject [ANN] Aenum 1.4.1
Date Wed, 04 May 2016 16:55:36 -0700
Lines 42
Approved python-announce-list@python.org
Message-ID <mailman.399.1462431628.32212.python-announce-list@python.org> (permalink)
References <572A8BF8.7000705@stoneleaf.us>
Reply-To python-list@python.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de I6UfIIn1veAW+BcicE/zyQAhQKCTHex9d3dUqOFvn2Jg==
Return-Path <ethan@stoneleaf.us>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'url:bitbucket': 0.05; 'attributes': 0.07; 'inserts': 0.07; 'subject:ANN': 0.07; 'type,': 0.07; 'enum': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'notation.': 0.09; 'prevents': 0.09; 'tuple': 0.09; 'python': 0.10; 'index': 0.13; 'attributes.': 0.16; 'iterated': 0.16; 'module:': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:': 0.16; 'sys.modules': 0.16; 'duplicate': 0.18; 'helper': 0.18; 'to:2**1': 0.21; 'constant': 0.22; 'converted': 0.22; 'symbolic': 0.22; "python's": 0.23; 'module': 0.25; 'header:User- Agent:1': 0.26; 'appear': 0.26; 'to:no real name:2**1': 0.27; 'values': 0.28; 'notation': 0.29; 'unique,': 0.29; 'classes': 0.30; 'creating': 0.30; 'class.': 0.30; 'compared': 0.30; 'class': 0.33; 'url:python': 0.33; 'accessible': 0.33; 'utility': 0.33; 'values.': 0.33; 'add': 0.34; 'there': 0.36; 'url:org': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.36; 'being': 0.37; 'creation': 0.38; 'itself': 0.38; 'names': 0.38; 'subject:[': 0.39; 'data': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'advanced': 0.61; 'skip:n 10': 0.62; 'within': 0.64; 'header :Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'enumeration': 0.84; 'enumeration,': 0.84; 'lacks': 0.84; 'reply- to:addr:python.org': 0.84
User-Agent Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
X-Mailman-Approved-At Thu, 05 May 2016 03:00:27 -0400
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list/>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <572A8BF8.7000705@stoneleaf.us>
Xref csiph.com comp.lang.python.announce:2125

Show key headers only | View raw


aenum 1.4.1

Advanced Enumerations (compatible with Python's stdlib Enum), 
NamedTuples, and NamedConstants

aenum includes a Python stdlib Enum-compatible data type, as well as a 
metaclass-based NamedTuple implementation and a NamedConstant class.

An Enum is a set of symbolic names (members) bound to unique, constant 
values. Within an enumeration, the members can be compared by identity, 
and the enumeration itself can be iterated over.  If using Python 3 
there is built-in support for unique values, multiple values, 
auto-numbering, and suspension of aliasing (members with the same value 
are not identical), plus the ability to have values automatically bound 
to attributes.

A NamedTuple is a class-based, fixed-length tuple with a name for each 
possible position accessible using attribute-access notation as well as 
the standard index notation.

A NamedConstant is a class whose members cannot be rebound; it lacks all 
other Enum capabilities, however; consequently, it can have duplicate 
values.

Utility functions include:

- skip: class that prevents attributes from being converted to a
         constant or enum member

- module: inserts NamedConstant and Enum classes into sys.modules
           where it will appear to be a module whose top-level names
           cannot be rebound

- extend_enum: add new members to enumerations after creation

- enum: helper class for creating members with keywords

- constant: helper class for creating constant members


https://pypi.python.org/pypi/aenum
https://bitbucket.org/stoneleaf/aenum

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

[ANN]  Aenum 1.4.1 Ethan Furman <ethan@stoneleaf.us> - 2016-05-04 16:55 -0700

csiph-web