[Python-Dev] I want my sugar...

Peter Hall bisfik at yahoo.com
Sun Jan 16 18:44:27 CET 2011


I am a newbie to python, and am curious why the following syntax is not 
supported:

# Boolean test on x...
if (x = someFunc(...)):
     # Do something with x...

I've found it convenient in perl.

Is the syntax actually supported, and I'm ignorant?
Is the usage considered 'unPythonic'?
Can you point me to any existing discussion of the issue (it must have come up 
before?)?

Thanks,
Peter



More information about the Python-Dev mailing list