How does Python (2.6.4 in particular) define common list membership? I checked a few tests to see what it does:
def main(): obj = fancy_obj(arg='C:\\') needle = (50, obj) haystack = [(50, fancy_obj(arg='C:\\')), (1, obj,), needle] print (1, fancy_obj(arg='C:\\'),) in haystack print needle in haystack if __name__ == '__main__': main()
What gives:
False True
This tells me that Python is probably checking for object references, which makes sense. Is there anything more definitive that I can look at?
python list
Chris
source share