PEP 824: None-coalescing operators

SC has decided to accept PEP 824 on the condition that the ??= operator is removed, leaving only the ?? operator in the proposal.

We see value in ?? as an explicit way to express a fallback for None. We think it stands on its own as an operator, making the operation easy to identify when reading an expression. Although introducing special syntax for None represents a change in Python’s mental model, we believe there is value in this focused use.

However, it does not mean that an assignment form is also justified. Syntax additions need to offer a clear benefit to readers, and SC members remain unconvinced that ??= sufficiently improves code readability. We also raised the lack of a corresponding or= operator as a concern during our discussion.

Thank you for your work on this proposal and for your patience throughout the discussions.

Warm regards,
Donghee
on behalf of the Python Steering Council

33 Likes