PEP 285: Adding a bool type

Max M maxm at mxm.dk
Sun Apr 7 09:27:59 EDT 2002


Ralph Corderoy wrote:

> I think we all perfectly understand your opinion too and no matter how
> many times you repeat it there will still be some of us that like to do
> 
>     a = b + is_movable(c


I can see that it is clever, but I don't get why it is smart. Isn't it 
just another way of writing?:

     if is_movable(c):
         a = b + 1

If it is, I find that it is more obfuscation than expression. It's akind 
to using a magic value. My paraphrase of our code should really read 
something like::

     motionLength = 1
     if is_movable(c):
         a = b + motionLength

Or your code should possibly have read::

     a = b + motionLength(c)

But probably I misunderstand you intentions.

regards Max M




More information about the Python-list mailing list