[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'.
From: |
Collin Funk |
Subject: |
gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'. |
Date: |
Mon, 8 Apr 2024 17:09:15 -0700 |
User-agent: |
Mozilla Thunderbird |
Hi Bruno,
On 4/8/24 2:19 PM, Bruno Haible wrote:
> 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.
Ah, okay yes that makes sense and seems to match what I have seen in
my little experience using it.
I had a Bioinformatics professor who wanted to scare us away from
using ChatGPT on homework/exams. He asked it a somewhat unique, as in
not easily found online, but interesting question about nucleotide
triplets that create stop codons [1]. I can't remember the exact
question, but ChatGPT would give very obviously incorrect answers and
insist it was correct if you mentioned it.
>> 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)'
>
Patch 0001.
>> 2. Use single quotes for string literals.
Patch 0002.
> 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.
Sounds good. In that case you have the option of double-quotes, raw
strings (r'...'), or three quotes ('''...'''). Since each of those has
their own upsides and limitations I have only changed double-quotes
which do not have an effect on backslashing if changed.
Also I ran all the tests successfully with Python 3.7 + 3.12 just to
make sure I didn't miss anything strange.
[1]
https://en.wikipedia.org/wiki/DNA_and_RNA_codon_tables#Standard_RNA_codon_table
Collin
0001-gnulib-tool.py-Prefer-list.append-item-over-list-ite.patch
Description: Text Data
0002-gnulib-tool.py-Use-single-quotes-for-strings.patch
Description: Text Data
- Re: gnulib-tool.py: lists vs. sets, (continued)
- 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, 2024/04/08
- 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 <=
- 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