Code basics

Alex alex at somewhere.round.here
Fri Mar 17 20:29:36 CET 2000


> Why should the return value of a logic test be "obscure" knowledge?

The return value itself is not terribly obscure, but your code's
reliance on it is relatively obscure, compared with something like

if predicate:
    result = true_value
else:
    result = false_value

I can understand the intent of this immediately, whereas with your code,
I had to think for a moment about what the results of your code could
be, and then determine the intent.

> Why "hide" something so basic?

It's not a question of information hiding, it's question of clarity.

Alex.



More information about the Python-list mailing list