lxml/lxml — pull request #61 by l33twolf (2012-07-05 17:06:50+00:00)
Title: fix exception handling in attribute comparison

Handle dumb comparisons between _Attrib and non-dict-like objects.
Return false for comparisons to objects that fail convert to dict.

There may be a better/faster/more efficient way to do this in cython (not so familiar with it), but this fixed my issue. I thought about testing the 'other' object for dict-likeness, but it isn't super easy as it not only has to be iterable but an iterable of iterables of length 2 unless it's already a dict or dict subclass... EAFP right?