pythonic way to compare compound classes?
<p>I have a class that acts as an item in a tree:</p>

<pre><code>class CItem( list ):
  pass
</code></pre>

<p>I have two trees, each with CItem as root, each tree item has some dict members (like item._test = 1). Now i need to compare this trees. I can suggest to overload a comparison operator for CItem:</p>

<pre><code>class CItem( list ):
  def __eq__( self, other ):
    # first compare items as lists
    if not list.__eq__( self, other ): return False
    # now compare dict members
    if self.__dict__ != other.__dict__: return False
    # seems equal
    return True
</code></pre>

<p>Now i can compare two trees using '==' or '!='. Is this a 'pythonic' way or such comparsion can be done easire?</p>
