Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to check for good change handler types #1209

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

kitchoi
Copy link
Contributor

@kitchoi kitchoi commented Jun 12, 2020

This PR adds a small test to check a few different types of change handlers can be used with observe.

Not sure why would any of the builtin get used with observe in real projects, but they do work now (as long as they accept one argument). From the experience of manual testing, being able to use print (or just any callable accepting one positional argument) with observe was quite handy. If it should stop being supported, at least the test will alert us.

Note: repr could not be used with on_trait_change.

Checklist

  • Tests
  • Update API reference (docs/source/traits_api_reference)
  • Update User manual (docs/source/traits_user_manual)
  • Update type annotation hints in traits-stubs

Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mdickinson mdickinson merged commit da03139 into master Jun 12, 2020
@mdickinson mdickinson deleted the tst-callable-types branch June 12, 2020 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants