summaryrefslogtreecommitdiff
path: root/nodes.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-03-21 17:18:18 +0100
committerAnthon van der Neut <anthon@mnt.org>2017-03-21 17:18:18 +0100
commit9ac44a0873d51d63150b0f1dc1d009b206577a29 (patch)
tree44fc2ecbdba2a6a63544097d7b9f63d8f87d5aae /nodes.py
parentc8568f99215aaa910953287f63a25459e3800dfc (diff)
downloadruamel.yaml-9ac44a0873d51d63150b0f1dc1d009b206577a29.tar.gz
update for mypy --strict, prepare de-inheritance (Loader/Dumper)0.14.0
Diffstat (limited to 'nodes.py')
-rw-r--r--nodes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nodes.py b/nodes.py
index b518513..b96524c 100644
--- a/nodes.py
+++ b/nodes.py
@@ -2,11 +2,14 @@
from __future__ import print_function
+from typing import Dict, Any, Text # NOQA
+
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
self.tag = tag
self.value = value
self.start_mark = start_mark
@@ -15,6 +18,7 @@ class Node(object):
self.anchor = None
def __repr__(self):
+ # type: () -> str
value = self.value
# if isinstance(value, list):
# if len(value) == 0:
@@ -33,6 +37,7 @@ class Node(object):
self.tag, value)
def dump(self, indent=0):
+ # type: (int) -> None
if isinstance(self.value, basestring):
print('{}{}(tag={!r}, value={!r})'.format(
' ' * indent, self.__class__.__name__, self.tag, self.value))
@@ -69,6 +74,7 @@ class ScalarNode(Node):
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)
self.style = style
@@ -78,6 +84,7 @@ class CollectionNode(Node):
def __init__(self, tag, value, start_mark=None, end_mark=None,
flow_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)
self.flow_style = flow_style
self.anchor = anchor