PEP 823 Proposes None-Aware Access Operators for Python 3.16
engineer
security feature patch
This Python Enhancement Proposal (PEP 823) introduces two new operators, `?.` for attribute access and `?[]` for indexing, designed to simplify handling of `None` values. These "None-aware" operators would evaluate the left-hand side, and only proceed if the result is not `None`, preventing `AttributeError` or `TypeError`. This aims to reduce boilerplate `is not None` checks and improve code readability, particularly for nested optional attributes or structured data traversal. The proposal is currently a draft targeting Python 3.16.
- →Security Implications
- →Add a maybekeyword
- →Change primaryrule to be right-recursive
Security (1) ›
- Security Implications
Features (1) ›
- Add a maybekeyword
Enhancements (1) ›
- Change primaryrule to be right-recursive
Read the original announcement →
https://peps.python.org/pep-0823/
Related releases
- PEP 824 Proposes None-Coalescing Operators `??` and `??=` for Python 3.16 Python PEPs ·
- LangGraph 1.2.12 improves subgraph detection and adds interrupt response schema LangGraph Releases ·
- LangGraph SDK 0.4.5 Adds `response_schema` to `interrupt()` Method LangGraph Releases ·
- Pydantic-AI v2.46.0 Enhances Type-Safe Models, Tooling, and Real-Time AI Sessions Pydantic AI Releases ·
- uv 0.12.17 Released with New Preview Features and Performance Boosts uv Releases ·
- ADK-Python v2.9.2 Refines OpenTelemetry Event Naming for Consistent Tracking Google ADK (Python) Releases ·