summaryrefslogtreecommitdiff
path: root/nodes.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-11-09 10:47:11 +0100
committerAnthon van der Neut <anthon@mnt.org>2018-11-09 10:47:11 +0100
commit68ea6b9ef755296c169b5416fe46ac48250e3c62 (patch)
tree8a44637378f20053b3c22ed342bdb2d13805dc97 /nodes.py
parent11e092f5746f4437628a4131ea8727db6c4c5692 (diff)
downloadruamel.yaml-68ea6b9ef755296c169b5416fe46ac48250e3c62.tar.gz
fix issue #194 object attributes always sorted0.15.77
Test for this issue in: https://bitbucket.org/ruamel/yaml.data/src/default/object/control_base_representer_mapping_sort.yaml *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 'nodes.py')
-rw-r--r--nodes.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/nodes.py b/nodes.py
index 0a35752..d99e909 100644
--- a/nodes.py
+++ b/nodes.py
@@ -12,14 +12,14 @@ if False: # MYPY
class Node(object):
__slots__ = 'tag', 'value', 'start_mark', 'end_mark', 'comment', 'anchor'
- def __init__(self, tag, value, start_mark, end_mark, comment=None):
- # type: (Any, Any, Any, Any, Any) -> None
+ def __init__(self, tag, value, start_mark, end_mark, comment=None, anchor=None):
+ # type: (Any, Any, Any, Any, Any, Any) -> None
self.tag = tag
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
self.comment = comment
- self.anchor = None
+ self.anchor = anchor
def __repr__(self):
# type: () -> str
@@ -78,14 +78,15 @@ class ScalarNode(Node):
__slots__ = ('style',)
id = 'scalar'
- def __init__(self, tag, value, start_mark=None, end_mark=None, style=None, comment=None):
- # type: (Any, Any, Any, Any, Any, Any) -> None
- Node.__init__(self, tag, value, start_mark, end_mark, comment=comment)
+ def __init__(self, tag, value, start_mark=None, end_mark=None, style=None, comment=None,
+ anchor=None):
+ # type: (Any, Any, Any, Any, Any, Any, Any) -> None
+ Node.__init__(self, tag, value, start_mark, end_mark, comment=comment, anchor=anchor)
self.style = style
class CollectionNode(Node):
- __slots__ = 'flow_style', 'anchor'
+ __slots__ = ('flow_style', )
def __init__(
self,