This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author clevy
Recipients clevy, martin.panter, rhettinger, serhiy.storchaka, stutzbach
Date 2015-06-12.05:48:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1434088098.0.0.470030121622.issue24434@psf.upfronthosting.co.za>
In-reply-to
Content
@serhiy.storchaka: I don't think that will work.

First of all,

    x, y = item

will raise a ValueError if fed an iterable whose length is not exactly 2, so you would have to check for that. Moreover, if item is something like a dict, for example, then:

    {"a": 1, "b": 2} in DictLikeMapping(a="b")

could return True, which I don't think would be expected behavior.

I'm not terribly fond of the instance check myself, but in this case I can't see any other way to do it: the built in dict_items necessarily consists of *tuples* of key-value pairs.
History
Date User Action Args
2015-06-12 05:48:18clevysetrecipients: + clevy, rhettinger, stutzbach, martin.panter, serhiy.storchaka
2015-06-12 05:48:18clevysetmessageid: <1434088098.0.0.470030121622.issue24434@psf.upfronthosting.co.za>
2015-06-12 05:48:17clevylinkissue24434 messages
2015-06-12 05:48:17clevycreate