[Twisted-Python] epydoc-breaking microdom bug

Christopher Armstrong radix at twistedmatrix.com
Sun Apr 6 19:11:48 MDT 2003


On Mon, Apr 07, 2003 at 08:40:43AM +1000, Jonathan M. Lange wrote:

> This fails when run with CVS latest, giving a "TypeError: unhashable instance"
> when trying to hash a tuple of microdom.Element and something else.
> 
> At Moshe's suggestion, I removed the __eq__ methods from microdom in my local
> copy, and generated the docs again. It generates the docs fine, but tests
> break. Further, I was told that including the __eq__ methods makes the
> behaviour of microdom incompatible with that of minidom, and that this is a
> really bad thing.
> 
> I'm too zonked to patch things properly atm; could someone please fix microdom
> and test_xml to not use / rely on __eq__ methods?

I think all that needs to be done is to add a __hash__ method. Just
make it return id(self) (which is how all instances are hashed by
default -- unless they have an __eq__, for some reason).

I don't know what's up with the microdom/minidom compatibility,
though.

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/




More information about the Twisted-Python mailing list