Introducing a Safe Navigation Operator in Python

I have reviewed PEP 505 and noticed that the document doesn’t provide explicit reasons for its deferral. However, I can make some educated guesses as to why it might have been deferred.

In terms of complexity,

  • The PEP proposes the introduction of new operators (??, ?., and ?[]), which could increase the language’s complexity.
  • The implementation of these operators would require substantial changes to Python’s grammar and could potentially introduce unforeseen issues or edge cases.

I think another reason might be that it proposes several changes to the Python language at once as follows;

  • None Coalescing Operator (??)
  • None-Aware Attribute Access Operator (?.)
  • None-Aware Indexing Operator (?)
  • Augmented Assignment for None Coalescing Operator (??=)

Introducing multiple new operators at once can add a level of complexity to the language. Each operator needs to be evaluated for its individual merit and how it integrates with existing features.

6 Likes