[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python list micro-benchmarks
From: |
Bruno Haible |
Subject: |
Re: Python list micro-benchmarks |
Date: |
Mon, 08 Apr 2024 23:19:47 +0200 |
Hi Collin,
> > - 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. :)
My experience is that ChatGPT (3.5) provides good answers for things that
have a lot of mentions on the web. Whereas for things that are rarely
mentioned, it starts to hallucinate and often provides wrong answers.
Therefore, for routine questions around Python or C++, it is perfectly
suited. Whereas for expert questions or things that require logical
reasoning, you better do a fact-checking on the answer.
> 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)'
OK.
> 2. Use single quotes for string literals.
OK in places where the strings don't contain single-quotes. In class
GLEmiter, in particular, there are many strings that contain commands
in shell syntax, and these often contain single-quotes. Here, choose
the style that best avoids backslashing.
Bruno
- Re: gnulib-tool.py: lists vs. sets, (continued)
- Re: gnulib-tool.py: lists vs. sets, Bruno Haible, 2024/04/06
- Re: gnulib-tool.py: lists vs. sets, Collin Funk, 2024/04/06
- Re: gnulib-tool.py: lists vs. sets, Bruno Haible, 2024/04/07
- Re: gnulib-tool.py: lists vs. sets, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Bruno Haible, 2024/04/07
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Paul Eggert, 2024/04/07
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Bruno Haible, 2024/04/08
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/08
- Re: Python list micro-benchmarks,
Bruno Haible <=
- Re: Python list micro-benchmarks, Paul Eggert, 2024/04/08
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/08
- gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'., Collin Funk, 2024/04/08
- Re: gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'., Bruno Haible, 2024/04/08
- Re: gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'., Collin Funk, 2024/04/08