Zac Burns wrote:
> Greetings,
>
> I have a dictionary that seems to be misbehaving on a membership
> check. This test code:
>
> 1: import types
> 2: assert myDict.__class__ is types.DictionaryType
[...]
For the record, it would be much simpler and more readable to say
assert type(myDict) is
Sorry everyone, I found the bug in my code shortly after posting here.
For the curious:
I was using a QString (pyqt) inadvertently in the lookup. I guess the
behavior then would be would be that QStrings hash differently than
strings which accounts for the membership check failure, but lists do
a
Greetings,
I have a dictionary that seems to be misbehaving on a membership
check. This test code:
1: import types
2: assert myDict.__class__ is types.DictionaryType
3: assert (key in myDict.keys()) == (key in myDict)
raises AssertionError on line three. The dictionary items are all of
type (str