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

Steven D'Aprano steve at pearwood.info
Thu Mar 7 19:12:37 EST 2019


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."


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


More information about the Python-Dev mailing list