summaryrefslogtreecommitdiff
path: root/tokens.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-07-17 09:53:27 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-07-17 09:53:27 +0200
commit0427670ffa4fd8f70824dbf9533514f9a4daeff3 (patch)
tree5ac3fdfa799aa2f48510a1f3e9cd7bcbdf373785 /tokens.py
parent9eb543eb3b1512a176f12ae6e4ba46ca6acf1b84 (diff)
downloadruamel.yaml-0427670ffa4fd8f70824dbf9533514f9a4daeff3.tar.gz
allow dump of deepcopied data from commented YAML0.15.100
fixes issue #295 *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'tokens.py')
-rw-r--r--tokens.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tokens.py b/tokens.py
index d476d49..84c6847 100644
--- a/tokens.py
+++ b/tokens.py
@@ -270,3 +270,15 @@ class CommentToken(Token):
except: # NOQA
pass
return 'CommentToken({})'.format(v)
+
+ def __eq__(self, other):
+ if self.start_mark != other.start_mark:
+ return False
+ if self.end_mark != other.end_mark:
+ return False
+ if self.value != other.value:
+ return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)