It doesn't read naturally to me,and tell me what it's doing. I'd rather end up with code like: if dictionary.itemequals(key,value): but that may just be my lack of familiary with Python showing. If the former code is idiomatic Python then go for it.
My brain clicked this morning, and suddenly the viewitems seems much more natural. I was clearly too tired to be looking at code when I commented last night.
On the other hand, I freely concede the horrificness of the NaN approach! But then, I never intended to put that one in actual code, only to post it on the Internet and marvel at how horrible it was :-)
if dictionary.itemequals(key,value):
but that may just be my lack of familiary with Python showing. If the former code is idiomatic Python then go for it.