Skip to content

Allow to hash extensions, thus allowing them as map keys. - #25

Closed
fab13n wants to merge 2 commits into
vsergeev:masterfrom
fab13n:master
Closed

Allow to hash extensions, thus allowing them as map keys.#25
fab13n wants to merge 2 commits into
vsergeev:masterfrom
fab13n:master

Conversation

@fab13n

@fab13n fab13n commented Jan 25, 2017

Copy link
Copy Markdown

Without this, you can't do:

umsgpack.dump({umsgpack.Ext(42, 'foo'): 'bar'})

@vsergeev

vsergeev commented Jan 26, 2017

Copy link
Copy Markdown
Owner

👍

My only request is to implement the mixing via hashing a tuple rather than addition, as recommended here https://docs.python.org/3/reference/datamodel.html#object.__hash__.. That way we can leverage whatever Python thinks the best way is to mix component hashes.

@fab13n

fab13n commented Feb 8, 2017

Copy link
Copy Markdown
Author

Good point; pull request updated.

@vsergeev

Copy link
Copy Markdown
Owner

Thanks, squashed and cherry-picked to 4c461ed in devel branch. It will be in the next release soon.

@vsergeev vsergeev closed this Mar 20, 2017
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.

2 participants