Skip to content

Commit 4935a5c

Browse files
committed
Updated YamlAble doc
1 parent ed81b1c commit 4935a5c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

yamlable/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ class YamlAble(AbstractYamlAble):
5555
metaclass magic).
5656
5757
The behaviour is very similar though:
58-
- fill the `__yaml_tag_suffix__` either directly or using the @yaml_info() decorator
58+
- fill the `__yaml_tag_suffix__` either directly or using the `@yaml_info()` decorator
59+
- optionally implement `__from_yaml_dict__` (class method called during decoding) and/or `__to_yaml_dict__`
60+
(instance method called during encoding) if you wish to have control on the process, for example to only dump part
61+
of the attributes or perform some custom instance creation. Note that default implementation relies on `vars(self)`
62+
for dumping and on `cls(**dct)` for loading.
5963
"""
6064
__yaml_tag_suffix__ = None
6165
""" placeholder for a class-wide yaml tag. It will be prefixed with '!yamlable/', stored in `YAMLABLE_PREFIX` """

0 commit comments

Comments
 (0)