[issue21620] OrderedDict KeysView set operations not supported

2014-05-31 Thread Matthew Lauria

New submission from Matthew Lauria:

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()

--
components: Library (Lib)
messages: 219454
nosy: Matthew.Lauria, rhettinger
priority: normal
severity: normal
status: open
title: OrderedDict KeysView set operations not supported
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21620] OrderedDict KeysView set operations not supported

2014-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Already fixed in issue8743.

--
nosy: +serhiy.storchaka
resolution:  - out of date
status: open - closed
superseder:  - set() operators don't work with collections.Set instances

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com