Immutability and Python

andrea crotti andrea.crotti.0 at gmail.com
Mon Oct 29 13:05:07 EDT 2012


2012/10/29 Paul Rubin <no.email at nospam.invalid>:
> andrea crotti <andrea.crotti.0 at gmail.com> 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..



More information about the Python-list mailing list