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

Paul Moore p.f.moore at gmail.com
Fri Mar 8 02:30:09 EST 2019


On Thu, 7 Mar 2019 at 23:58, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
> Paul Moore wrote:
> > There's a subtle difference in the mathematical
> > and computing meanings [of idempotent] (around functions
>  > with side-effects, which aren't a thing in maths)
>
> Not really an issue here, since optionxform shouldn't be having
> side effects if it's sane.
>
> In any case, the word is easy enough to avoid in this case.
> 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."
>

Precisely. +1 on this wording if we choose to go this way.

If someone *really* wants to link the idea to the term "idempotent"
then a simple "(i.e., the function must be idempotent)" would be
sufficient to confirm for people who know the term, avoid making it
unclear for people who don't, and teach people who don't the meaning
of the term.

Paul


More information about the Python-Dev mailing list