[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as

Glyph glyph at twistedmatrix.com
Wed Feb 27 02:10:17 CET 2013

On Feb 26, 2013, at 5:25 AM, Eli Bendersky <eliben at gmail.com> wrote:

> Glyph, thanks for the input. I mentioned Twisted because in its code I found a number of places with simple string enumerations used to represent state. I was not aware of twisted.python.constants, but it doesn't appear that this module is used  at least in the places I checked.

Quite so.  twisted.python.constants was created because we made the same observation that you did.  Hopefully, more of these protocols will be transitioned to make use of twisted.python.constants internally.

> In general, many protocols have some "state" instance var that's usually just a string, using either predefined constants or direct string literals.

Indeed.  This idiom varies considerably.  Another thing that Twisted needs is a mechanism for explicitly building state-machine, but that's a discussion for another day.


More information about the Python-Dev mailing list