So do you propose getting rid of the tuple type entirely or not?

Do you see why it's useful to have immutability?

------- Original Message -------
On Friday, March 11th, 2022 at 4:47 PM, David Mertz, Ph.D. 
<david.me...@gmail.com> wrote:

> Yes. To be clear, immutability isn't a use case, it's a particular technique 
> that can be useful for solving some problems.
>
> This is probably a clear enough example of the XY-problem as to be worth 
> adding to the Wikipedia article on that topic.
>
> We sometimes see other similar proposals to e.g. "solve" the "problem" that 
> Python isn't statically typed. That is, folks who want Python to be some 
> different language.
>
> On Fri, Mar 11, 2022, 4:42 PM wfdc <w...@protonmail.com> wrote:
>
>> (To be clear, I'm saying David Mertz's proposal fails the immutability 
>> criterion, not Christopher Barker's.)
>>
>> ------- Original Message -------
>> On Friday, March 11th, 2022 at 4:39 PM, wfdc <w...@protonmail.com> wrote:
>>
>>> Don't yell.
>>>
>>> You just effectively re-implemented Christopher Barker's solution (which 
>>> was also present in the StackOverflow thread), with the downside that it 
>>> fails the immutability criterion.
>>>
>>> Saying "just be careful not to mutate the original datastructure" isn't a 
>>> solution. There's a reason we have immutable types: To enforce​ 
>>> immutability. Otherwise, why aren't you proposing getting rid of the tuple 
>>> type entirely?
>>>
>>> ------- Original Message -------
>>> On Friday, March 11th, 2022 at 4:29 PM, David Mertz, Ph.D. 
>>> <david.me...@gmail.com> wrote:
>>>
>>>> On Fri, Mar 11, 2022, 4:16 PM wfdc via Python-ideas 
>>>> <python-ideas@python.org> wrote:
>>>>
>>>>>> why haven't you used a list
>>>>> 2. I don't want to modify the original sequence.
>>>>
>>>> There's a really easy solution for you that will even be more perfomant.
>>>>
>>>> Use a list and DON'T modify the original!
>>>>
>>>> This is ABSOLUTELY an XY-problem.... which fact was difficult to wrestle 
>>>> out of you.
>>>>
>>>>>>> stuff1 = [a, b, c, d]
>>>>>>> stuff2 = stuff1[:]
>>>>>>> stuff2[2] = e
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/K3CWHSBWAA5PANVV44CVQPDVEAIYAJ7N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to