New syntax for safe attribute and safe subscript access

Thanks for the suggestion. I went on a bit of a tour starting at that PEP. Looks like the latest discussion of operators like the ones I suggested is here.

There are a lot of arguments in that thread that I respect. I found Steve Dower’s post especially compelling. He argues that operators like ?[ shift expectations around use of the language towards being more unexplained-None-friendly. Seems like a real worry to me: if anyone doubts that Python features change the culture around the data that Python code operates on, they need look no further than the introduction of type hinting.

I do think that this comes into conflict with this argument from you, Chris. At the risk of putting words in your mouth, it sounds like you’re saying that Python is already permissive enough that it allows for plenty of bad code patterns, and that this is a cost intentionally paid to enable other good use cases. Also seems reasonable.

So on this point, I want to defer to others. A crux here might be pinpointing how opinionated a language Python should be, and that feels well above my pay grade.

1 Like