On Sun, 08 Apr 2007 02:40:52 GMT, Alan Isaac wrote
> "Carsten Haese" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Adding useless features always makes a product worse. What's your use
> > case for tuple.index?
> [...] consider a game,
> where the fixed set p of players have a fixed order.
> A tuple is natural.  Now for a player you want to
> construct the opponents.  If I had the index i it wd
> be p[:i]+p[i+1:], but how to get the index?

opponents = tuple(x for x in p if x is not current_player)

-Carsten

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to