[Python-ideas] Add MutableSet.update?

MRAB python at mrabarnett.plus.com
Fri Mar 9 21:24:07 EST 2018


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, so if the name 
on the LHS isn't local it'll raise NameError.

Does that matter?

> On Fri, Mar 9, 2018 at 4:48 PM, Lucas Wiman <lucas.wiman at gmail.com 
> <mailto:lucas.wiman at gmail.com>> wrote:
> 
>     I was trying to use `collections.abc.MutableSet` today, and noticed
>     that it does not define an `update` method. This is a very useful
>     method that is present on the builtin `set` class, and seems to fit
>     naturally with the other methods.
> 
>     Was omitting this method intentional?
> 
>     Thanks & best wishes,
>     Lucas Wiman
> 


More information about the Python-ideas mailing list