Python, concise way to test membership in collection using partial match
- by aaa
hello.
What is the pythonic way to test if there is a tuple starting with another tuple in collection? actually, I am really after the index of match, but I can probably figure out from test example
for example:
c = ((0,1),(2,3))
# (0,) should match first element, (3,)should match no element
I should add my python is 2.4 and/or 2.5
thanks