It is also good to know that  overriding the "comparison magic methods" in
your class can be very useful if you wish to apply sorting/searching
procedures available in python.

If you also implement __gt__, __lt__, __ge__, __le__  in your class, then
you can append each of your objects to a list and successfully use the
sorted () function on that list.  It will enable you to have your list
sorted by some other variables within your class, such as the number
scored.

John S
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to