Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Tuples and immutability Date: Wed, 12 Mar 2014 10:23:27 +1300 Lines: 24 Message-ID: References: <531f3dfb$0$29994$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net d4Wd/Ob7MLN39tlsmqLdNg6OhKvHsViOi80X6sTdXKHwyI8iL0 Cancel-Lock: sha1:pFFDM+SCytXaZovOViXozjIwkFs= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <531f3dfb$0$29994$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:68239 Steven D'Aprano wrote: > On Tue, 11 Mar 2014 04:39:39 -0600, Ian Kelly wrote: > >>On Mon, Mar 10, 2014 at 11:03 PM, Gregory Ewing > >>What's the obvious way >>>to spell in-place set intersection, for example? > > I would expect it to be &=, That's my point -- once you know the binary operator for an operation, the corresponding in-place operator is obvious. But there's no established standard set of method names for in-place operations -- each type does its own thing. >>You mean set.intersection_update? The in-place set methods are not hard >>to remember, because they all end in _update. For that particular type, maybe, but I wouldn't trust that rule to extend to other types. -- Greg