Clarity vs. code reuse/generality

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Jul 6 14:32:10 CEST 2009


kj wrote:
>  I've rewritten it like this:
>
>     sense = cmp(func(hi), func(lo))
>     assert sense != 0, "func is not strictly monotonic in [lo, hi]"
>
> Thanks for your feedback!
>
> kj
>   

As already said before, unlike other languages, sense in english does 
**not** mean direction. You should rewrite this part using a better 
name. Wrong informations are far worse than no information at all.

JM



More information about the Python-list mailing list