Set attribute instead of property.

Fix #3130.
Merge pull request #3131 from braddunbar/save-example

Set attribute instead of property.