News for hackers. Stuff that matters.
Re:What's New in Python 3.11? by duckerude on Monday June 27, 2022 @05:23AM (#31892276)
That problem also exists in sets because some values that aren't interchangeable still compare equal:

  >>> {1} | {1.0} | {True}
  {1}
But the behavior for dicts is surprising even in that light:

  >>> {1: 1} | {1.0: 1.0} | {True: True}
  {1: True}
Re:What's New in Python 3.11? by wodenokoto on Tuesday June 28, 2022 @08:13AM (#31906685)
But that is not really the `|` operators fault. You get the exact same behaviour when you create a dictionary.

    >>> {1: 1, 1.0: 1.0, True: True}
    {1: True}
So `|` between dictionaries behaves just as you'd expect, if your expectations about creating a dictionary are correct. I think that's very reasonable.
Re:What's New in Python 3.11? by kzrdude on Monday June 27, 2022 @05:27AM (#31892308)
bool as int is sometimes useful and often infuriating