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
multistring needs a __hash__ method #3434
Milestone
Comments
FWIW Also, I don't see any differences across versions with the snippet you provided: In [1]: from translate import __version__
In [2]: __version__.sver
Out[2]: '1.13.0'
In [3]: from translate.misc.multistring import multistring
In [4]: foo = multistring('foo')
In [5]: foodict = { foo: 'bar' }
In [6]: assert 'foo' in foodict In [1]: from translate import __version__
In [2]: __version__.sver
Out[2]: '1.14.0-rc1'
In [3]: from translate.misc.multistring import multistring
In [4]: foo = multistring('foo')
In [5]: foodict = { foo: 'bar' }
In [6]: assert 'foo' in foodict |
@julen i think i may have got this the wrong way round it shoud read
|
WFM. |
phlax
added a commit
to phlax/translate
that referenced
this issue
Apr 26, 2016
Previously you were able to do `str in dict_with_multistring_key` and because the str and multistring hashes matched it would find the dict element. This test demonstrates that this is no longer possible. ref translate#3434
not sure if you mean code or test @julen ive added a PR to demonstrate the problem and fix it |
for ref here is the test failing https://travis-ci.org/phlax/translate/jobs/125898982#L1126 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In old ttk you could do something like
It seems this no longer works - not sure why, but a
__hash__
method that returnshash(str(self))
should fix the problem i believe@claudep @julen any thoughts on this?
The text was updated successfully, but these errors were encountered: