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

2013年2月26日 17:14:54 -0800

On Feb 26, 2013, at 5:25 AM, Eli Bendersky <[email protected]> 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
[email protected]
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