jacebrowning / yorm

Automatic object-YAML mapping for Python.
https://yorm.readthedocs.io
MIT License
27 stars 6 forks source link

Maintain identity when attributes are referenced #55

Closed jacebrowning closed 9 years ago

jacebrowning commented 9 years ago

Fixes #47

jacebrowning commented 9 years ago

Converter (immutable) should have to_value/to_data.

Convertible (mutable) should extend Converter and add apply_value/format_data:

During "store", to_data is always called on the converter class.

During "fetch", apply_value is called on the attribute if it's an instance of the converter class and the converter class subclasses Convertible, else to_value is called on the converter class.