LangWart: Method congestion from mutate multiplicty

Mark Janssen dreamingforward at gmail.com
Sun Feb 10 05:53:42 CET 2013


On Sat, Feb 9, 2013 at 8:20 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Sun, Feb 10, 2013 at 2:54 PM, Rick Johnson
> <rantingrickjohnson at gmail.com> wrote:
>> My point was this: All mutate methods should mutate "in-place", if the programmer wishes to create a mutated copy of the object, then the programmer should /explicitly/ create a copy of the object and then apply the correct mutator method to the copy.
>
> I agree. And we can go further and declare that there is only one data
> [sarcasm]

I have to agree with Rick, I think requiring the user to explicitly
create a new object, which is already a good and widely-used practice,
should be the Only One Way to Do It.  Guessing method names is far
suboptimal to this simple, easy idiom.  As for the point Chris was
making as to making all types one, I actually agree there too, it's
just that in order to do that, python would need a unified object
model and it doesn't have one yet.

Mark



More information about the Python-list mailing list