summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-07-12 15:11:29 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-07-12 15:11:29 +0200
commita509d2fac7baff28de5a41f40c44f003f50055fd (patch)
tree9f35c46ad1aa6b589c0accabd7ad4d377bc13662 /main.py
parent03bb05a79ac40ddd34812d2f3c7cc7cf8ac5fc98 (diff)
downloadruamel.yaml-a509d2fac7baff28de5a41f40c44f003f50055fd.tar.gz
resolves issue #186: facilitate register_class as decorator
*When this change indeed resolves your problem, please **Close** this issue*. *(You can do so usingthe WorkFlow pull-down (close to the top right of this page)*
Diffstat (limited to 'main.py')
-rw-r--r--main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.py b/main.py
index 8fff056..46ffc14 100644
--- a/main.py
+++ b/main.py
@@ -481,7 +481,7 @@ class YAML(object):
return res
def register_class(self, cls):
- # type:(Any) -> None
+ # type:(Any) -> Any
"""
register a class for dumping loading
- if it has attribute yaml_tag use that to register, else use class name
@@ -506,6 +506,7 @@ class YAML(object):
return constructor.construct_yaml_object(node, cls)
self.constructor.add_constructor(tag, f_y)
+ return cls
# ### backwards compatibility
def _indent(self, mapping=None, sequence=None, offset=None):