python syntax for conditional is unfortunate

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Sep 24 09:23:49 CEST 2008


Neal Becker a écrit :
(snip)
> I find I'm often tripped up by:
> 
> x = Y (lots of  constructor arguments....) if something ...
> 
> on first glance, I don't notice the if.

Indeed. The inline conditionnal syntax is obviously innappropriate here. 
It's just like list-comprehensions : just fine for simple use case, 
definitively not appropriate when it comes to anything complex. IOW : 
it's not the syntax that's unfortunate, it's the coding style that's wrong.

My 2 cents...




More information about the Python-list mailing list