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 tests to boundedattributes ctor PR #3531

Conversation

pmcollins
Copy link
Member

Description

Add test coverage to this PR so we can get it merged.

torarvid and others added 6 commits June 2, 2023 15:05
There is no risk of locking issues during a constructor call. It is also
not desirable to lock-unlock-... for each provided attribute to the
constructor.

This commit seeks to improve on these by refactoring __setitem__ such
that the 'body' inside the lock context manager is moved to a separate
method _unsafe__setitem. This method can then be called by internal
methods without taking the lock first.

Another method 'update' (overridden from MutableMapping) is added that
takes the lock *once* and then calls another new method _unsafe_update,
which in turn simply iterates the attribute items and calls
_unsafe__setitem on them.
@pmcollins pmcollins changed the title Faster boundedattributes ctor tests Add tests to boundedattributes ctor PR Nov 15, 2023
@pmcollins pmcollins closed this Mar 13, 2024
@pmcollins
Copy link
Member Author

Cleaning up.

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.

4 participants