Friday, October 16, 2026 Today’s Paper
Log in Join free
Vol. I · No. 17 Texas Edition
Friday, Oct 16
Texas first. Then the world.
Always free Updated 2 minutes ago
Read. React. Discuss.
Tech

Show HN: I added optional chaining to CPython

By grandimam 1 min read 6 views 0 comments

I forked CPython to experiment with adding optional chaining (?.) directly to the language.For example:
name = response?.customer?.name.lower()If response or customer is None, the expression short-circuits and evaluates to None. This isn't a library or a transpiler change, but a direct CPython modification.A bit about the build: I used AI extensively for this experiment. Part of my motivation was to see how far I can get the modification in an unfamiliar codebase like CPython.A couple of hours in I had a working prototype. I would appreciate feedback from people familiar with CPython internals about the implementation.Source: https://github.com/grandimam/cpython

Comments URL: https://news.ycombinator.com/item?id=50046196

Points: 2

# Comments: 0

Hacker News (Newest) Original story · github.com
Read the full story

Discussion (0)

No comments yet. Start the conversation!