<div dir="ltr">These were exactly my thoughts. I wanted to bump this, since it was drowned out by more important things like Paths and invertible booleans and almost no discussion was had on the main issue, that of dict views not acting like sets. Since things have died down, is that behavior that should be remedied, and if so should it be backwards compatible (make set more permissive), treat it as a bugfix (make the views raise errors)? And should it include union/other methods to keep performance on the usecase that now throws a bug?<div><br></div><div>-Josh<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 7, 2016 at 1:53 PM Michael Selik <<a href="mailto:mike@selik.org">mike@selik.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Apr 6, 2016, at 10:38 AM, Joshua Morton <<a href="mailto:joshua.morton13@gmail.com" target="_blank">joshua.morton13@gmail.com</a>> wrote:<br>
>     set() | []  # 2<br>
>     {}.keys() | []  # 3<br>
<br>
Looks like this should be standardized. Either both raise TypeError, or both return a set. My preference would be TypeError, but that might be worse for backwards-compatibility.<br>
<br>
>     {}.keys().union(set())  # 6<br>
<br>
Seems to me that the pipe operator is staying on MappingView, so it's reasonable to add a corresponding ``.union`` to mimic sets. And intersection, etc.<br>
<br>
>     {}.values() == {}.values()  # 9<br>
>     d = {}; d.values() == d.values()  # 10<br>
<br>
It's weird, but float('nan') != float('nan'). I'm not particularly bothered by this.</blockquote></div></div></div>