Skip to content

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 <david.feltell@foundry.com>
@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
@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