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 Matthew.Lauria
Recipients Matthew.Lauria, rhettinger
Date 2014-05-31.15:51:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401551472.98.0.0437808757217.issue21620@psf.upfronthosting.co.za>
In-reply-to
Content
I noticed that doing set operations on an OrderedDict KeysView only works when the KeysView is the first input to the expression, and not when it's the second input. This is not the case for dicts.

Python 3.4.1 (default, May 31 2014, 11:25:02) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections
>>> x = collections.OrderedDict()
>>> x.keys() - set()
set()
>>> set() - x.keys()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'set' and 'KeysView'

>>> y = {}
>>> y.keys() - set()
set()
>>> set() - y.keys()
set()
History
Date User Action Args
2014-05-31 15:51:13Matthew.Lauriasetrecipients: + Matthew.Lauria, rhettinger
2014-05-31 15:51:12Matthew.Lauriasetmessageid: <1401551472.98.0.0437808757217.issue21620@psf.upfronthosting.co.za>
2014-05-31 15:51:12Matthew.Laurialinkissue21620 messages
2014-05-31 15:51:11Matthew.Lauriacreate