Re:Composing Programs – Python 3 in the tradition of SICP
by tome on Monday April 11, 2016 @03:35AM
(#11470125)
> Note that just because something is mutable doesn't mean you have to mutate it
I agree, and I don't mutate it, but my third party libraries and my collegues functions will. Not all of them, but enough to introduce annoying bugs.
Re:Composing Programs – Python 3 in the tradition of SICP
by devishard on Monday April 11, 2016 @10:10AM
(#11471567)
This is why I asked, "Which library are you having a problem with?"
You've claimed that third party libraries and your colleague's functions will mutate the data structures you pass them, but this has very rarely been my experience.
Here's my favored source (in the Standard Library) https://docs.python.org/2/library/collections.html#collectio...
> and what do you do when every third party library you interact with uses mutable ones?
That's situational; which library are you having a problem with? I haven't really had that problem (okay, sometimes the tooling around web frameworks do stupid things, but that's not common).
Note that just because something is mutable doesn't mean you have to mutate it. Yes, Python doesn't as widely enforce non-mutation as Haskell, OCaml, etc., but that doesn't mean that suddenly all the Python programmers lost their minds and started mutating all the things. We're not savages.