Comment on Adding syntax to the CPython interpreterparentComments−__mharrison__1yThis doesn't work because the if statement is a statement. Statements don't evaluate to anything in Python, so you can't assign it to x.−8n4vidtmkvmk1yHence "make it an expression"−otabdeveloper41yIt's way to late to fix the "statement vs expression" bug in Python's design.We could have done that in the v3 switch, but we decided to spend man-centuries of effort on chasing already deprecated legacy Windows Unicode semantics instead.
Comments
This doesn't work because the if statement is a statement. Statements don't evaluate to anything in Python, so you can't assign it to x.
Hence "make it an expression"
It's way to late to fix the "statement vs expression" bug in Python's design.
We could have done that in the v3 switch, but we decided to spend man-centuries of effort on chasing already deprecated legacy Windows Unicode semantics instead.