smarie/python-yamlable

Simplify abstract yaml-able class definition by removing `NONE_IGNORE_CHECKS`

Closed this issue · 0 comments

As of today all classes are checked for an explicit __yaml_tag_suffix__ (if inheriting from YamlAble) or a yaml_tag (if using YamlObject2). If this field is not explicitly present, exceptions are raised (when dumping/loading for YamlAble and at class definition time for YamlObject2).

Because of the above behaviour, it was not possible to define an abstract parent class for several yaml-able types, with common yaml-ability. Therefore a NONE_IGNORE_CHECKS symbol was introduced so that abstract classes could use it in place of their yaml_tag or yaml_tag_suffix. This symbol is redundant with a simple usage of None. This should be simplified, we can probably safely remove NONE_IGNORE_CHECKS (keeping it for legacy, but it will be equal to None).