On Sat, Mar 10, 2018 at 2:45 PM, Chris Barker <chris.bar...@noaa.gov> wrote: > On Sat, Mar 10, 2018 at 3:24 AM, MRAB <pyt...@mrabarnett.plus.com> wrote: >> >> On 2018-03-10 01:15, Guido van Rossum wrote: >>> >>> Yes, you can use the |= operator instead. >>> >> |= is not quite the same as .update because it rebinds, > > > isn't that an "in-place operator" i.e. if it's a mutable object it should > mutate rather than rebinding?
Normally on a mutable object, |= will mutate the object in-place AND ALSO rebind the name to the same object it started with (like writing 'x = x'). The latter part raises an error if 'x' is not a legal target for assignment. -n -- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/