"/a" is not "/a" ?

Mel mwilson at the-wire.com
Sat Mar 7 08:43:54 EST 2009


 wrote:

> Steven D'Aprano <steve at pearwood.info> writes:
>> It is never
>> correct to avoid using "is" when you need to compare for identity.
> 
> When is it ever necessary to compare for identity?

Ho-hum.  MUDD game.

def broadcast (sender, message):
    for p in all_players:
        if p is not sender:
            p.tell (message)    # don't send a message to oneself


	Mel.





More information about the Python-list mailing list