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 and b.

----------
components: Interpreter Core
messages: 279622
nosy: levinvm
priority: normal
severity: normal
status: open
title: if inline statement does not work with multiple assignment.
type: crash
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28550>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to