[Python-Dev] configparser: should optionxform be idempotent?

Eric V. Smith eric at trueblade.com
Fri Mar 8 03:26:56 EST 2019


> On Mar 8, 2019, at 12:12 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> 
>> On Fri, Mar 08, 2019 at 12:56:13PM +1300, Greg Ewing wrote:
>> 
>> In any case, the word is easy enough to avoid in this case.
> 
> I don't think we should avoid using standard terminology even if we can. 
> Knowledge of standard terminology is useful, and we don't generally make 
> a practice of talking about (e.g.) "simultaneously running subtasks" 
> when we can say "threads" instead.
> 
> You are happy to use the jargon terms "function" and "canonical form" 
> without explanation, which I think proves that one person's jargon is 
> another's obvious, clear, precise technical terminology.
> 
> 
>> We could say something like:
>> 
>>   "The optionxform function transforms option names to a
>>   canonical form. If the name is already in canonical form,
>>   it should be returned unchanged."
> 
> How about:
> 
>    "The optionxform function transforms option names to a
>    canonical form. This should be an idempotent function: 
>    if the name is already in canonical form, it should be 
>    returned unchanged."

I’d prefer something less passive than “it should remain unchanged” (as my high school English teacher would say: “by whom?”). Something like “If optionxform is called on a name that is already in canonical form, then it should return that name unchanged”.  Then add something like “That is, optionxform should be idempotent”.

Eric

> 
> 
> requires six extra words, but it uses the correct technical term which 
> will be familiar to some proportion of users, while also explaining the 
> term for those who aren't familiar with it. We all win!
> 
> 
> -- 
> Steven
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/eric%2Ba-python-dev%40trueblade.com



More information about the Python-Dev mailing list