
July 19, 2018
6:43 p.m.
On Thu, Jul 19, 2018 at 11:37 AM Brendan Barnwell <brenbarn@brenbarn.net> wrote:
As far as I can see, these null-coalescing operators would break that model. The PEP doesn't seem to provide for a "real" magic method allowing users to override the actual behavior of the method. (You can only override __has_value__ to hook into it, but not define by fiat what A ?? B does, as you can with other operators.) And I think the reason for this is that the operator itself is too specific, much more specific in semantics than other operators. (I had similar doubts about adding the matrix-multiplication operator @.)
It is just as specific as the `is` operator, and for the same reason. Elazar