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 steven.daprano
Recipients Joshua Morton, steven.daprano
Date 2016-05-08.06:00:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20160508060030.GT12028@ando.pearwood.info>
In-reply-to <1462681499.01.0.123702812837.issue26973@psf.upfronthosting.co.za>
Content
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.
History
Date User Action Args
2016-05-08 06:00:36steven.dapranosetrecipients: + steven.daprano, Joshua Morton
2016-05-08 06:00:36steven.dapranolinkissue26973 messages
2016-05-08 06:00:36steven.dapranocreate