more example below:
if (a = xyz() ) > abc:
Really want to know why, is it kinds of bad smell ?
Note: I know the grammar, but I am asking why Python don’t support such grammar as many other language( e.g., c , java…) do supporting
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the python design FAQ:
As explained in the FAQ, most “use cases” for using assignment in an expression can be covered by using iterators instead.