Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32385 > unrolled thread
| Started by | andrea crotti <andrea.crotti.0@gmail.com> |
|---|---|
| First post | 2012-10-29 15:44 +0000 |
| Last post | 2012-10-29 15:44 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Immutability and Python andrea crotti <andrea.crotti.0@gmail.com> - 2012-10-29 15:44 +0000
| From | andrea crotti <andrea.crotti.0@gmail.com> |
|---|---|
| Date | 2012-10-29 15:44 +0000 |
| Subject | Re: Immutability and Python |
| Message-ID | <mailman.3020.1351525475.27098.python-list@python.org> |
2012/10/29 Jean-Michel Pichavant <jeanmichel@sequans.com>: > > "return NumWrapper(self.number + 1) " > > still returns a(nother) mutable object. > > So what's the point of all this ? > > JM > Well sure but it doesn't modify the first object, just creates a new one. There are in general good reasons to do that, for example I can then compose things nicely: num.increment().increment() or I can parallelize operations safely not caring about the order of operations. But while I do this all the time with more functional languages, I don't tend to do exactly the same in Python, because I have the impression that is not worth, but maybe I'm wrong..
Back to top | Article view | comp.lang.python
csiph-web