Message265114
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. |
|
Date |
User |
Action |
Args |
2016-05-08 06:00:36 | steven.daprano | set | recipients:
+ steven.daprano, Joshua Morton |
2016-05-08 06:00:36 | steven.daprano | link | issue26973 messages |
2016-05-08 06:00:36 | steven.daprano | create | |
|