diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-07-12 15:11:29 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-07-12 15:11:29 +0200 |
commit | a509d2fac7baff28de5a41f40c44f003f50055fd (patch) | |
tree | 9f35c46ad1aa6b589c0accabd7ad4d377bc13662 /main.py | |
parent | 03bb05a79ac40ddd34812d2f3c7cc7cf8ac5fc98 (diff) | |
download | ruamel.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.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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): |