Author levinvm
Recipients levinvm
Date 2016-10-28.18:07:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477678025.32.0.74165596104.issue28550@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-10-28 18:07:05levinvmsetrecipients: + levinvm
2016-10-28 18:07:05levinvmsetmessageid: <1477678025.32.0.74165596104.issue28550@psf.upfronthosting.co.za>
2016-10-28 18:07:05levinvmlinkissue28550 messages
2016-10-28 18:07:05levinvmcreate