Hi Piotr, 

doesn't Doug's reply of 8:03 address this point? As he says, the none-aware 
operator never gives you None when you ask for a missing attribute (these cases 
always raise an exception). If we look at these two alternatives

phone1 = book.publisher?.owner.phone
phone2 = book.publisher.owner.phone if book.publisher else None

then they behave exactly the same. If we would misspell "owner" then in both 
versions we'd get the same AttributeError under the same conditions.

Best,
Maarten
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/KSKTJRNSQSBRYZRY6QQY7B3TZ5J4P2PD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to