tuples, index method, Python's design

Delaney, Timothy (Tim) tdelaney at avaya.com
Wed Apr 11 01:36:17 CEST 2007


Carsten Haese wrote:

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

That would perform better as:

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

Tim Delaney



More information about the Python-list mailing list