International
The Morning Dev

Only the news worth knowing

‹
 

News

Python's None-Aware Operators: Yes to Coalescing, Careful With Access

DEV · By Mango Developer ·

Python's None-Aware Operators: Yes to Coalescing, Careful With Access

The Brief

  • Two draft PEPs by Marc Mueller, sponsored by Guido van Rossum, propose None-aware operators for Python.
  • The proposals add a ?. (optional attribute access) and a ?? (null coalescing) operator.
  • The drafts target Python 3.16.

Why it matters

If accepted, Python code could check for None with shorter syntax, but the proposals are still drafts and the source suggests caution about how the access operator is used.

Who’s affected

  • Python developers
  • Python 3.16
  • #python
  • #syntax
  • #pep
  • #null-handling
  • #language-proposal

Python has been without a ?. and a ?? for the whole of its life, and every few years someone proposes them and the argument runs out of steam. This time looks different. Two draft PEPs, written by Marc Mueller and sponsored by Guido van Rossum, target Python 3.16, and the…

How do you feel about this?

0 Comments

    Python's None-Aware Operators: Yes to Coalescing, Careful With Access – The Morning Dev