Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.200 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.61; '*S*': 0.01; 'apis': 0.09; 'assumed': 0.09; 'python': 0.11; 'in-place,': 0.16; 'mutable': 0.16; 'wrote:': 0.18; 'solutions.': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'possibility': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'not.': 0.33; 'classes': 0.35; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'method': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'free': 0.61; 'new': 0.61; 'course': 0.61; 'situation': 0.65; 'us:': 0.65; 'mar': 0.68; 'circle': 0.68; 'design.': 0.68; 'irrelevant': 0.84; 'ugly,': 0.84; 'stretch': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=KyhYgk6AT6HeIPfefSIM/FaS4tKzMhQz/7tmOXQMRFc=; b=zu9a4jieKT0+JVqnpYuvdetvgFMZAwYk3VozyHM2Mq9bUeI9m1+q9l179OghUj0yCg KLozwLdOv9icABf/YNY54EZ3kA9wqYUWeDSti8KXU/KrFVd0GpMr9FDPXkI9SdsF8ogQ R0FqaU8UO0ywM7J+pFKG4DtGFGViNEpSlHE18DZZ7cq0gwVA3RFg/j0PShHyLA3MPFSq pjM9s0UopcP4LtE122bCdgjRDtM6fHFX8ZQvvm7qtkCeGkmsBIf6ixIRTsL2x/TyeGd9 uT6Obp5LzPvq8pVYv5hioKe2DYna/GEKvPGLRNmulF91eJUKjbtoVegeV/GYDM9haKIs r0OQ== X-Received: by 10.68.191.39 with SMTP id gv7mr873756pbc.90.1394579243304; Tue, 11 Mar 2014 16:07:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <531f3dfb$0$29994$c3e8da3$5496439d@news.astraweb.com> References: <531f3dfb$0$29994$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Tue, 11 Mar 2014 17:06:43 -0600 Subject: Re: Tuples and immutability To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394579251 news.xs4all.nl 2914 [2001:888:2000:d::a6]:46849 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68248 On Tue, Mar 11, 2014 at 10:46 AM, Steven D'Aprano wrote: >> There are a number of possible solutions. One possibility would be to >> copy the Circle as an Ellipse and return the new object instead of >> mutating it. Then you have the situation where, given a mutable object >> x that satisfies isinstance(x, Ellipse), the stretch method *may* be >> able to update the object in-place, or it *may* not. > > That is a really lousy design. Of course we are free to create classes > with ugly, inconsistent, stupid or unworkable APIs if we like. Python > won't stop us: That's true but irrelevant to my point, which was to counter the assertion that mutable types can always be assumed to be able to perform operations in-place.