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

[Core] Use frozenset for Python kTraitSet #90

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

feltech
Copy link
Member

@feltech feltech commented Aug 19, 2024

Closes #55. Define the Python Specifications trait set using a frozenset so it can be hashed. Simplifies switching on trait set in manager implementations in Python, where a handler map is a nice way to structure code. I.e. a frozenset can be used as a dictionary key.

@feltech feltech self-assigned this Aug 19, 2024
@feltech feltech requested a review from a team as a code owner August 19, 2024 13:06
Closes OpenAssetIO#55. Define the Python Specifications trait set using a
`frozenset` so it can be hashed. Simplifies switching on trait set in
manager implementations in Python, where a handler map is a nice way to
structure code. I.e. a `frozenset` can be used as a dictionary key.

Signed-off-by: David Feltell <[email protected]>
@feltech feltech force-pushed the work/55-frozensetForTraitSet branch from 8dd0317 to aa01b95 Compare August 19, 2024 13:16
Copy link

@foundry-markf foundry-markf left a comment

Choose a reason for hiding this comment

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

Had to do similar when wanting to use a set as a hash or a dict key, so LTGM

@feltech feltech merged commit 495f75f into OpenAssetIO:main Aug 19, 2024
14 checks passed
@feltech feltech deleted the work/55-frozensetForTraitSet branch August 19, 2024 16:38
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.

Use frozenset for Specification.kTraitSet
2 participants