On 26 Feb 2006 22:30:28 -0800, rumours say that "Crutcher"
<[EMAIL PROTECTED]> might have written:

>This seems great, except why can't I compare strings? It seems too
>useful when dealing with user input, or parsing messages or config
>files.
>
>>>> Weekdays = enum('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat')
>>>> Weekdays.mon.__cmp__('mon')

some_value = Weekdays.thu
...
user_input = raw_input("Enter day name")
if user_input == str(some_value):

>Additionaly, perhaps the call method of the enumeration object should
>construct a value from strings?
>>>> Weekdays.mon == Weekdays('mon')

Either way works for me.
-- 
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to