
Sept. 15, 2022
4:44 p.m.
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