[issue28550] if inline statement does not work with multiple assignment.

2016-10-31 Thread Eric Snow
Changes by Eric Snow : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28550] if inline statement does not work with multiple assignment.

2016-10-28 Thread Eric Snow
Eric Snow added the comment: The syntax is working correctly. Precedence rules are throwing you off. It should be more clear if we use parentheses to demonstrate precedence explicitly. You expected: a, b = (obj.a, obj.b) if obj else [None, None] However, what you wrote is equivalent to: a,

[issue28550] if inline statement does not work with multiple assignment.

2016-10-28 Thread Levi Velázquez
New submission from Levi Velázquez: Normal "if" inline assignment obj = None a = obj.a if obj else None It assign None to a as expected. obj = None a, b = obj.a, obj.b if obj else [None, None] It raises an error " 'NoneType' object has no attribute 'a'" when it should assign None to both a