On Feb 26, 2013, at 5:25 AM, Eli Bendersky <eli...@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.

-glyph

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to