Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed7.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'cpython': 0.05; 'default.': 0.07; 'semantic': 0.07; 'table.': 0.07; 'likewise': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'python.': 0.11; 'exception': 0.13; 'exceptions.': 0.16; 'immutability': 0.16; 'immutable,': 0.16; 'low-level': 0.16; 'mutated': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'instance,': 0.18; 'working.': 0.18; 'changes': 0.20; 'ron': 0.22; 'tuples': 0.22; 'cheers,': 0.24; 'seems': 0.24; 'header:In-Reply-To:1': 0.24; 'raise': 0.24; "we'd": 0.24; 'second': 0.24; 'header:User- Agent:1': 0.26; 'idea': 0.26; 'header:X-Complaints-To:1': 0.26; 'separate': 0.27; 'initial': 0.29; "i'm": 0.29; 'strings,': 0.29; 'objects': 0.29; 'regardless': 0.31; 'avoiding': 0.33; 'raising': 0.33; 'changing': 0.34; 'needed': 0.34; 'could': 0.35; 'to:addr :python-list': 0.35; 'eric': 0.35; 'necessary.': 0.35; 'something': 0.35; "isn't": 0.35; 'too': 0.36; '(i.e.': 0.36; 'subject:: ': 0.37; 'level': 0.37; 'associated': 0.38; 'received:org': 0.38; 'skip:p 20': 0.38; 'space': 0.38; 'pm,': 0.39; 'test': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.40; 'some': 0.40; 'even': 0.61; 'more': 0.62; 'here': 0.66; 'talking': 0.67; 'header:Reply-To:1': 0.67; 'reply- to:no real name:2**0': 0.71; 'reply-to:addr:gmail.com': 0.77; '(ie': 0.84; 'much,': 0.84; 'step.': 0.91; 'proposal.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ron Adam Subject: Re: Lawful != Mutable (was Can Python function return multiple data?) Date: Sun, 21 Jun 2015 08:55:53 -0400 References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <55710b69$0$12980$c3e8da3$5496439d@news.astraweb.com> <6c78b294-efd6-4096-a572-1841aa71a5eb@googlegroups.com> <557182af$0$13014$c3e8da3$5496439d@news.astraweb.com> <33a2f501-5587-4fd9-91fa-7094d4f6c512@googlegroups.com> <81cb1232-ecf8-4cf0-b29c-ecf2ca47ade0@googlegroups.com> <5fa1f672-50de-4481-9c5b-2c68c4e30f12@googlegroups.com> <4fdc38b3-6b51-4f98-9ba3-42b265582fc0@googlegroups.com> <762816ac-c744-480b-a9f9-a0110451c516@googlegroups.com> <5037b4a5-94a9-4995-828f-9624804da20a@googlegroups.com> Reply-To: ron3200@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ip98-170-222-146.pn.at.cox.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <5037b4a5-94a9-4995-828f-9624804da20a@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434891363 news.xs4all.nl 2882 [2001:888:2000:d::a6]:44490 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 5726 X-Received-Body-CRC: 2133286041 Xref: csiph.com comp.lang.python:92957 On 06/20/2015 10:50 PM, Rustom Mody wrote: > Here is Eric Snow: > > | Keep in mind that by "immutability" I'm talking about*really* > | immutable, perhaps going so far as treating the full memory space > | associated with an object as frozen. For instance, we'd have to > | ensure that "immutable" Python objects like strings, ints, and tuples > | do not change (i.e. via the C API). The contents of involved > | tuples/containers would have to be likewise immutable. Even changing > | refcounts could be too much, hence the idea of moving refcounts out to > | a separate table. > | > | This level of immutability would be something new to Python. We'll > | see if it's necessary. If it isn't too much work it might be a good > | idea regardless of the multi-core proposal. > > Does the second para look like CPython implementation or python-the-language? > > Also note the 'Even' in the first para. ie Eric is talking of low-level > (ie thread-safety, refcounting etc) immutability after the even and higher > level semantic immutability before It seems to me, this will take a lot more changes to python overall. Adding a way to raise an exception if an object is mutated would be a good initial step. Have it turned off by default. I think it will be needed to test how any of the above is working. It may also allow some multiprocessing just by avoiding raising any MutatedObject exceptions. Cheers, Ron