Skip to content

Commit

Permalink
Merge pull request #529 from krinsman/master
Browse files Browse the repository at this point in the history
Minor addition to docs
  • Loading branch information
rmorshea authored Aug 12, 2019
2 parents 8b9981b + 1cb5b46 commit 41551bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/source/using_traitlets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ Basic Example: Validating the Parity of a Trait
parity_check.value = 1
parity_check.parity = 1
Notice how all of the examples above return
``proposal['value']``. This is necessary for validation to work
properly, since the new value of the trait will be the
return value of the function decorated by ``@validate``. If this
function does not have any ``return`` statement, then the returned
value will be ``None``, instead of what we wanted (which is ``proposal['value']``).

However, we recommend that custom cross-validators don't modify the state of
the HasTraits instance.

Expand Down

0 comments on commit 41551bc

Please sign in to comment.