Skip to content

Commit

Permalink
#400 include type of self in tuple for node comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
arporter committed Apr 17, 2023
1 parent 32c9e45 commit 2096c15
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fparser/two/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def init(self, *items):
Store the supplied list of nodes in the `items` list of this node.
:param items: the children of this node.
:type items: tuple of :py:class:`fparser.two.utils.Base`
:type items: Tuple[:py:class:`fparser.two.utils.Base`]
"""
self.items = items
Expand All @@ -540,8 +540,11 @@ def __repr__(self):
return self.torepr()

def _cmpkey(self):
"""Provides a key of objects to be used for comparing."""
return self.items
"""
:returns: a tuple of objects to be used for comparing nodes.
:rtype: Tuple[:py:class:`fparser.two.utils.Base`]
"""
return tuple(list(self.items).append(type(self)))

def tofortran(self, tab="", isfix=None):
"""
Expand Down

0 comments on commit 2096c15

Please sign in to comment.