tuple/string compare
Aahz Maruch
aahz at panix.com
Mon Oct 23 14:06:40 EDT 2000
In article <8t1hg5$v9p$1 at nnrp1.deja.com>,
Ari Davidow <ari_deja at ivritype.com> wrote:
>
>('foo.html',) is in the dictionary
>foo.html is my string, newUrl
>
> if myOldStuff.has_key(newUrl): print "bingo"
> else: pass
>>> dict={('foo',):None}
>>> dict
{('foo',): None}
>>> url = 'foo'
>>> dict.has_key(url)
0
>>> dict.has_key((url,))
1
--
--- Aahz (Copyright 2000 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"Boy, I got vision, and the rest of the world wears bifocals." --Butch Cassidy
More information about the Python-list
mailing list