Propagating poorly chosen idioms

Raymond Hettinger vze4rx4y at verizon.net
Tue Apr 5 19:34:47 EDT 2005


[Skip Montanaro]
> This reminded me of something I noticed awhile ago.  If you're learning
> something new, there is a tendency to find a working example to start from,
> then modify it to suit your needs.  This is fine as far as it goes, however,
> if the idioms used in the code you're cloning are suboptimal, they get
> cloned.
>
> Unittest's API is difficult enough for me to remember (at least the initial
> framework I need to put together) that I generally hunt down some previous
> unittest usage, clone it and start from there.  I no longer have any idea
> what the original unittest example was that got me started using it in the
> first place (probably something in the distro's docs).  I can only hope it
> was a good example.

If it was the distro or tutorial example, I hope you thought it was good.

I added those examples to the docs with the intention facilitating
cut-and-paste jobs so folks could get up and running quickly.

The remainder of the unittest docs are somewhat obtuse and uninspiring.



> >From that standpoint the simpler API of py.test seems attractive.

That is their number one selling point.  I hope they don't lose it as the
package evolves to include doctests and such.



Raymond Hettinger





More information about the Python-list mailing list