Steven D'Aprano added the comment:

On Sun, May 08, 2016 at 04:24:59AM +0000, Joshua Morton wrote:

> Following the comments in python ideas [1] [...]
> 
> [1] https://mail.python.org/pipermail/python-ideas/2016-April/039469.html

Am I missing something? I don't see anything resembling a consensus that 
the behaviour of dict views is a bug in that thread, in fact I hardly 
see any discussion about this specific behaviour. (Other related topics 
are discussed in more depth.)

I don't think it is a bug for views to permit non-set arguments with 
binops:

py> {'a': 1, 'b': 2}.keys() & ['a', 'c']
{'a'}

I think it is a matter of taste. My own taste tells me that sets should 
be more restrictive, only accepting other [frozen]sets or subclasses, 
but views should be less restrictive, and perform more duck-typing of 
"set-like" objects, including lists. No, I can't justify it, except by 
an appeal to status quo: that's how it is now, and I don't think that 
changing it is worth breaking backwards compatibility.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to