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

Fix a bad Instance trait declaration for a private lock #1410

Closed
wants to merge 5 commits into from

Conversation

mdickinson
Copy link
Member

This PR fixes a bad Instance declaration that effectively declared that a _lock trait could only be assigned a built-in function or method (and in particular, could not be assigned a lock).

I really wanted to rename the events trait to _events too as part of this PR, but I can't be absolutely sure that it's not being used elsewhere. (And it is used in the tests, which isn't a great sign.)

No regression test, because I couldn't find a way to exercise the issue using only the public API, and I don't really want to add tests that test internal implementation details. However, if/when we deprecate Instance(some_instance), this code will now fail to give a DeprecationWarning, where the code in master would have given such.

Fixes #1408.

Checklist

  • Tests. No test provided. Sorry.
  • [ ] Update API reference (docs/source/traits_api_reference). N/A
  • [ ] Update User manual (docs/source/traits_user_manual). N/A
  • [ ] Update type annotation hints in traits-stubs. N/A

@mdickinson
Copy link
Member Author

Whoops. Bad branch.

@mdickinson mdickinson closed this Jan 18, 2021
@mdickinson mdickinson deleted the fix/bad-lock-type branch January 18, 2021 15:53
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.

Unittest tools has Instance(threading.Lock) trait definition that doesn't behave as intended.
1 participant