Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32391
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <andrea.crotti.0@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'modify': 0.05; 'python': 0.09; 'dict': 0.09; 'immutable': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; 'suggest': 0.11; 'language': 0.14; 'immutable,': 0.16; 'instance,': 0.17; 'python?': 0.20; 'trying': 0.21; 'meant': 0.21; 'received:209.85.214.174': 0.21; 'cc:2**0': 0.23; 'example': 0.23; 'this:': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'post': 0.28; 'dictionary': 0.29; 'oop': 0.29; 'objects': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; "i'm": 0.29; 'languages': 0.33; 'received:google.com': 0.34; 'expected': 0.35; 'received:209.85': 0.35; 'add': 0.36; 'really': 0.36; 'but': 0.36; 'functional': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'apply': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'first': 0.61; 'necessarily': 0.63; 'skip:n 10': 0.63; 'state.': 0.71; 'doi': 0.84 |
| 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:to :cc:content-type; bh=LG6zJtWCuGOEWKjQ4qS5GTRQfFx31KN3g/skg9ygm58=; b=AFvgTXHi3AC1eTnFCknwWW5nlgmTaQz9kLlgGZ+t+K5YFUD0BmwUGu1+5G0RG1VaZT oILA9WbZ8A8IQWM6WLTKu+swV8tYrSujdIxc8QIknNMoP7mBy9Eo5iFp3VcC6Q+Cwu7f +UCBOh0p4sgmUw+VIfoUNEduVh0gXhU5zDlLSCGcqhUz4Lkue5orriXtv8TJufCGFcEN 1OUDqTKl8e9EhleDrU/Fo0OJ/vkLhC/xSij8qy15lBkgVWRiLKWiE6YI9cJfVFHKjXm6 pI7+qnwolmxlkYMAhFgBBEH8tSTm1tmcKHfS6UmMynkvKNdTueyxXI50/D5B70AABn6P pkOw== |
| MIME-Version | 1.0 |
| In-Reply-To | <1793477354.3492917.1351526431192.JavaMail.root@sequans.com> |
| References | <CAF_E5Jbf0KJjDLV0jS-p_J9E4D8=_sPScgE+vkmkN2sMw=3aoA@mail.gmail.com> <1793477354.3492917.1351526431192.JavaMail.root@sequans.com> |
| Date | Mon, 29 Oct 2012 16:12:29 +0000 |
| Subject | Re: Immutability and Python |
| From | andrea crotti <andrea.crotti.0@gmail.com> |
| To | Jean-Michel Pichavant <jeanmichel@sequans.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Cc | python-list <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3025.1351527152.27098.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1351527152 news.xs4all.nl 6887 [2001:888:2000:d::a6]:36386 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:32391 |
Show key headers only | View raw
2012/10/29 Jean-Michel Pichavant <jeanmichel@sequans.com>:
>
>
> In an OOP language num.increment() is expected to modify the object in place.
> So I think you're right when you say that functional languages technics do not necessarily apply to Python, because they don't.
>
> I would add that what you're trying to suggest in the first post was not really about immutability, immutable objects in python are ... well immutable, they can be used as a dict key for instance, your NumWrapper object cannot.
>
>
> JM
Yes right immutable was not the right word, I meant that as a contract
with myself I'm never going to modify its state.
Also because how doi I make an immutable object in pure Python?
But the example with the dictionary is not correct though, because this:
In [145]: class C(object):
.....: def __hash__(self):
.....: return 42
.....:
In [146]: d = {C(): 1}
works perfectly, but an object of class C can mutate as much as it
wants, as my NumWrapper instance..
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Immutability and Python andrea crotti <andrea.crotti.0@gmail.com> - 2012-10-29 16:12 +0000
Re: Immutability and Python Paul Rubin <no.email@nospam.invalid> - 2012-10-29 09:46 -0700
Re: Immutability and Python andrea crotti <andrea.crotti.0@gmail.com> - 2012-10-29 17:05 +0000
Re: Immutability and Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-29 22:30 +0000
Re: Immutability and Python Chris Kaynor <ckaynor@zindagigames.com> - 2012-10-29 15:45 -0700
Re: Immutability and Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-29 23:14 +0000
Re: Re: Immutability and Python Evan Driscoll <driscoll@cs.wisc.edu> - 2012-10-29 12:58 -0500
Re: Immutability and Python Terry Reedy <tjreedy@udel.edu> - 2012-10-29 14:03 -0400
Re: Immutability and Python Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-10-29 14:25 -0400
csiph-web