added support for local aliasing of some attributes. the technique used is not very good but covers at least some of the more common use cases
--HG--
branch : trunk
diff --git a/jinja2/nodes.py b/jinja2/nodes.py
index 0db061a..1f742fa 100644
--- a/jinja2/nodes.py
+++ b/jinja2/nodes.py
@@ -234,7 +234,8 @@
todo.extend(node.iter_child_nodes())
def __eq__(self, other):
- return type(self) is type(other) and self.__dict__ == other.__dict__
+ return type(self) is type(other) and \
+ tuple(self.iter_fields()) == tuple(other.iter_fields())
def __ne__(self, other):
return not self.__eq__(other)
@@ -242,7 +243,7 @@
def __hash__(self):
if not self.frozen:
raise TypeError('unfrozen nodes are unhashable')
- return hash(tuple(self.__dict__.items()))
+ return hash(tuple(self.iter_fields()))
def __repr__(self):
return '%s(%s)' % (