On 4/8/24 7:23 AM, Bruno Haible wrote:
> - It explains ChatGPT's failure: Probably there are more explanations
> regarding += on strings, on the web, than regarding += on lists.
> So ChatGPT used the "common" explanation, for strings, and then
> substituted s/string/list/.
Interesting. I know very little about ChatGPT so that explanation
works for me. :)
> Thanks. Now I agree to converging on .append(..), because by my common
> measure "what is surprising to a naïve developer?" the '+= [item]'
> syntax has two negative scores:
> - It's surprising that += is optimized differently than +.
> - It's surprising that lists are optimized differently than strings.
Sounds good. What do you think about two patches to normalize the
existing code with the conventions we've agreed upon:
1. Convert '+= [item]' to '.append(item)'
2. Use single quotes for string literals.
I noticed many string literals use double quotes ("...") yesterday.
These are from before we agreed upon using single quotes.
I think it would be nice to have everything in agreement, but I
figured it is best to ask first.
Collin