Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; 'python': 0.09; 'immutable': 0.09; 'cc:addr:python-list': 0.10; 'anyway': 0.11; 'extensions': 0.13; '(online': 0.16; 'already,': 0.16; 'beginning.': 0.16; 'bind': 0.16; 'rise': 0.16; 'variable': 0.20; 'python?': 0.20; 'trying': 0.21; 'meant': 0.21; 'cc:2**0': 0.23; 'programming': 0.23; 'cc:no real name:2**0': 0.24; 'paul': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'guess': 0.27; 'message-id:@mail.gmail.com': 0.27; 'once.': 0.29; 'writes:': 0.29; 'url:mailman': 0.29; 'classes': 0.30; 'url:python': 0.32; 'could': 0.32; 'url:listinfo': 0.32; 'certain': 0.33; 'languages': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; 'url:org': 0.36; 'useful': 0.36; 'possible': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'gives': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'url:mail': 0.40; 'evaluate': 0.62; 'techniques': 0.63; 'more': 0.63; 'andrea': 0.84; 'doi': 0.84; 'well..': 0.84; 'approach.': 0.91; 'to:none': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=SzM78xTzxqB42c54TgbcbQE+sEY4TvWCrI28CMtLHu0=; b=AL7TPhQOnvWm4NJlm4PpImcd8zuAAeOeBGMSTL0XQc1fjncVUrP7+XdlspdlkD+kdG yGnbtMQrpwX/7DndvMIe0eCWFnYlKbD+XiDX8658lJWf+p/CSmyL8HUrKkElMlQShiCW AsB+35YBA0+SRRFvVOjLgwSFBdoJBh14OAFvSD97Yeo3zABJ+vhWIgZV5RzDtxz4Fv/E n6aqW47QZDH1ltejaa9jvOFcU7wHYTzMqdLn2qIvRZZtKpzVNn38zS+hvzUT7hgSYUCX 860c9jwvXEsl5Dc6mn0+8nfhD/Ph0ICjk0XZoZA8QnaEn86+2sffMkHJVnI8OrSLeSO2 pyfQ== MIME-Version: 1.0 In-Reply-To: <7x625t6xaj.fsf@ruckus.brouhaha.com> References: <1793477354.3492917.1351526431192.JavaMail.root@sequans.com> <7x625t6xaj.fsf@ruckus.brouhaha.com> Date: Mon, 29 Oct 2012 17:05:07 +0000 Subject: Re: Immutability and Python From: andrea crotti Cc: python-list@python.org 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351530311 news.xs4all.nl 6922 [2001:888:2000:d::a6]:51800 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32403 2012/10/29 Paul Rubin : > andrea crotti writes: >> Also because how doi I make an immutable object in pure Python? > > Numbers in Python are already immutable. What you're really looking for > is a programming style where you don't bind any variable more than once. > > This gives rise to a programming style that Python can support to a > certain extent, but for which some other languages are designed from the > beginning. > > You might look at http://learnyouahaskell.com (online book) if you want > to try the above approach. > -- > http://mail.python.org/mailman/listinfo/python-list I meant how do I create new immutables classes myself, I guess that's possible writing C extensions but I don't see in pure Python.. Anyway I know haskell already, and that's one of the reasons why I was trying to evaluate if the same techniques could be useful in Python as well..