optional-chaining

How to chain attribute lookups that might return None in Python?

How to chain attribute lookups that might return None in Python? Question: My problem is a general one, how to chain a series of attribute lookups when one of the intermediate ones might return None, but since I ran into this problem trying to use Beautiful Soup, I’m going to ask it in that context. …

Total answers: 7