[Gustavo Niemeyer] > I'm wondering what is causing this confusion then: > > % ./python > Python 2.4a0 (#5, May 25 2004, 13:45:26) > [GCC 3.3.3 (release)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > [...] > >>> l = [] > >>> l == l > Got in list_richcompare()! > True > >>> if l == l: print "foo" > ... > Got in list_richcompare()! > foo My mistake! And my apologies. PyObject_RichCompare() (not ...Bool()) gets called in this case, and it can't infer anything from object identity alone. The list object may, but it's quite possible that trying to would cost more cycles than it saved.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4