podqast
Python BytesMichael Kennedy and Calvin Hendryx-ParkerAll episodes

#499 So many questions??

33 min
Next episode#500 Episode 500!1h 08m
Get its new episodes on Latest. No account

Topics covered in this episode:

Watch on YouTube

About the show

Sponsored by us! Support our work through:

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesday at 7am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Michael #1: PEP 824 brings ?? and ??= to Python for None handling

PEP 824, a new draft from Marc Mueller sponsored by Guido van Rossum, proposes None-coalescing operators for Python 3.16. The ?? operator returns its left-hand side unless that value is None, and ??= assigns a fallback only when the target is None. It revives the long-deferred PEP 505 from over a decade ago, trimmed to just these two operators, with None-aware access split off into PEP 823. The goal is replacing verbose is None checks with something closer to or, but keyed on None instead of truthiness.

# OG way
user = db.get_user()
city = None
if user is not None:
if user.address is not None:
if user.address.city is not None:
city = u

Episode page ↗
More from Python Bytes