> they may have to spend time patiently arguing for it, answering objections, 
> demonstrating use cases, covering corner cases, discussing 
> alternatives/variations etc.

That's what I'm doing.

A direct writing style does not mean "belligerent".

> But it seems to me that something you can implement as a 1-liner in your own 
> code is hardly a pressing need.

1. As Christopher Barker and Marco Sulla pointed out, it's not the most 
efficient implementation. The latter may be more elaborate. It's worth 
exploring further.

2. Regardless of whether it's a 1-liner (like the existing count method), if a 
function is used frequently, it's worth considering as an addition to the 
standard library. This saves users from having to reimplement the same utility 
function again and again across projects, possibly making errors in the process.

> I wasn't aware of namedtuple's _.replace method. But as far as I can see, the 
> API is not the same as your proposed method either.

I raised it as an example of modifying an immutable type.

The exact API of the proposed method is open to discussion.

> That, it seems to me, is a pretty insulting thing to say

Not at all. It's appropriate given the tone and content of the post it's 
addressed to.

> to someone who, I would guess, has been using Python for decade(s) longer 
> than you have.

1. On what basis? You don't know who I am.

2. How long they've been using Python is irrelevant. It's also strange to bring 
up the Python-age of participants after protesting appeal to authority.

> Likewise this which you wrote in another post: "Do you see why it's useful to 
> have immutability?"

That's not insulting at all. It's a perfectly valid question to address to a 
post that seems to be contesting the purpose of immutable types in the first 
place.

------- Original Message -------
On Friday, March 11th, 2022 at 5:38 PM, Rob Cliffe <rob.cli...@btinternet.com> 
wrote:

> This is a common scenario on python-list or python-ideas:
> Someone has an idea that they think is the greatest thing since sliced bread. 
> They propose it, and feel hurt / rejected when they get pushback instead of 
> everyone jumping up and down and saying how brilliant it is.
> Sometimes they are downright rude.
> I wouldn't say you've quite crossed that line, but your tone certainly comes 
> across (to me at least) as belligerent. It won't help your cause to put 
> people's backs up. I apologise if that's not how you meant it.
> Of course occasionally someone comes up with a really good idea. But most 
> proposals fail to gain traction because they are actually not a very good 
> idea, or there is not enough support for them, or simply because no-one is 
> prepared to put in the effort (e.g. to write a PEP and/or make a reference 
> implementation, etc.) The default position is "status quo wins" because there 
> is a cost for every feature added. It has to be implemented. Tests have to be 
> written for it. It has to be maintained. The online documentation has to be 
> updated. Many books on Python become out of date until/unless the authors (if 
> still alive) can update them. It's one more thing that people (may) have to 
> learn when they learn Python. Net result: quite a high bar for changes (even 
> small ones).
>
> Even on the (few) occasions when someone has a really good, new idea, they 
> may have to spend time patiently arguing for it, answering objections, 
> demonstrating use cases, covering corner cases, discussing 
> alternatives/variations etc. before their idea gains support.
>
> My opinion on it's own counts for nothing. I'm not even saying your proposal 
> is a bad idea. But it seems to me that something you can implement as a 
> 1-liner in your own code is hardly a pressing need.
>
> I wasn't aware of namedtuple's _.replace method. But as far as I can see, the 
> API is not the same as your proposed method either. Quoting from
> https://stackoverflow.com/questions/2166147/namedtuple-replace-doesnt-work-as-described-in-the-documentation
>  :
>>>> from collections import namedtuple
>>>> Point = namedtuple('Point', 'x,y')
>>>>
>>>> p = Point(x=11, y=22)
>>>>
>>>> p._replace(x=33)
> Point(x=33, y=22)
>
> There is no index (0, 1, 2 ...), instead there is a name.
>
> On 11/03/2022 21:43, wfdc via Python-ideas wrote:
>
>> Wrong.
>>
>> If you're not willing to make substantive contributions to this thread, I 
>> suggest you refrain from posting further.
>
> That, it seems to me, is a pretty insulting thing to say to someone who, I 
> would guess, has been using Python for decade(s) longer than you have.
> Likewise this which you wrote in another post:
>
> Do you see why it's useful to have immutability?
>
> Best wishes
> Rob Cliffe
>
>> ------- Original Message -------
>> On Friday, March 11th, 2022 at 4:42 PM, David Mertz, Ph.D. 
>> [<david.me...@gmail.com>](mailto:david.me...@gmail.com) wrote:
>>
>>> So it appears the "problem" this is intended to solve is "Python isn't 
>>> Haskell."
>>>
>>> But Haskell exists, and this is a non-problem looking for a solution.
>>>
>>> On Fri, Mar 11, 2022, 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/DUJND4AXSODQAKRMA7NYRYREBXBAZ635/
>> Code of Conduct:
>> http://python.org/psf/codeofconduct/
_______________________________________________
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/YJCY2WXIESW7ICCIWQLBHVZSKGN2JBE3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to