<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6" -->

---
title: Python 3.15 Preview: Sentinel Values – Real Python
description: Python 3.15 introduces a built-in sentinel type via PEP 661, addressing longstanding drawbacks of the object() idiom used for signaling values like 'missing'...
canonical: https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Python 3.15 Preview: Sentinel Values – Real Python | daily.dev
og:description: Python 3.15 introduces a built-in sentinel type via PEP 661, addressing longstanding drawbacks of the object() idiom used for signaling values like 'missing'...
og:url: https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6
og:image: https://api.daily.dev/og/posts/yFzNnFAB6.png
og:image:alt: Python 3.15 Preview: Sentinel Values – Real Python
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Python 3.15 Preview: Sentinel Values – Real Python

**[Real Python](https://daily.dev/sources/rpython)** · 29 min read · 0 upvotes · 0 comments

## Summary

Python 3.15 introduces a built-in sentinel type via PEP 661, addressing longstanding drawbacks of the object() idiom used for signaling values like 'missing' or 'no default'. Unlike object(), sentinel instances print a readable name instead of a memory address, provide a distinct type usable in type hints, and preserve identity through copy(), deepcopy(), and pickle round trips. The tutorial walks through creating sentinels with sentinel(name, repr=None), explains pickling rules (name must match variable or qualified class attribute name), and compares sentinel against None, object(), custom classes, and Enum. Guidance is given on when to still use None, when to reach for sentinel, and how to use the typing_extensions backport on Python 3.14 and earlier.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://realpython.com/python315-sentinel-values>

## Questions this post answers

### What new built-in does Python 3.15 add for creating sentinel values?

Python 3.15 adds a built-in sentinel type through PEP 661, so no import is required. You create one by calling sentinel(name, repr=None), where name is a required positional-only string and repr is an optional keyword-only override for the displayed value. It fixes the object() idiom's unreadable repr, missing type, and broken identity after copy or pickle.

_Track Python 3.15 changes like this one on daily.dev before they hit your production code._

### Why does copy.deepcopy() break identity checks on an object() sentinel in Python?

Deep-copying an object() instance creates a brand-new object, so an identity check like deepcopy(_MISSING) is _MISSING returns False. The same happens with a pickle round trip. This can silently corrupt data, for example causing a copied patch dictionary to write a meaningless object into a real field like an email address instead of leaving it untouched.

_Developers debugging copy or pickle identity bugs can follow python releases on daily.dev._

### How do you make a sentinel value picklable in Python 3.15?

A sentinel is picklable only when pickle can find it by module and name: at module level the sentinel's name argument must exactly match its variable name, and at class scope it must match the fully qualified name, such as sentinel('Config.AUTO') for a class attribute named AUTO. A mismatched name, a typo, or a sentinel local to a function will raise a PicklingError.

_daily.dev helps developers stay current on Python API details like sentinel pickling rules._

## Similar posts on daily.dev

- [PEP 661 – Sentinel Values](https://daily.dev/posts/pep-661-sentinel-values-yujk1mknv) · Lobsters · 1 upvotes · 0 comments
- [TIL \#144 – Sentinel built-in](https://daily.dev/posts/til-144-sentinel-built-in-phazt8awu) · Planet Python · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Python 3.15 Preview: Sentinel Values – Real Python","url":"https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6"},"datePublished":"2026-09-28T14:11:34.944Z","dateModified":"2026-09-28T14:11:59.999Z","description":"Python 3.15 introduces a built-in sentinel type via PEP 661, addressing longstanding drawbacks of the object() idiom used for signaling values like 'missing'...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/04673a84659a742320974b3dc0318b96?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/04673a84659a742320974b3dc0318b96?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Real Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Real Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rpython","url":"https://daily.dev/sources/rpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python","timeRequired":"PT29M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Real Python","item":"https://daily.dev/sources/rpython"},{"@type":"ListItem","position":3,"name":"Python 3.15 Preview: Sentinel Values – Real Python"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/python-3-15-preview-sentinel-values-real-python-yfznnfab6#faq","mainEntity":[{"@type":"Question","name":"What new built-in does Python 3.15 add for creating sentinel values?","acceptedAnswer":{"@type":"Answer","text":"Python 3.15 adds a built-in sentinel type through PEP 661, so no import is required. You create one by calling sentinel(name, repr=None), where name is a required positional-only string and repr is an optional keyword-only override for the displayed value. It fixes the object() idiom's unreadable repr, missing type, and broken identity after copy or pickle. Track Python 3.15 changes like this one on daily.dev before they hit your production code."}},{"@type":"Question","name":"Why does copy.deepcopy() break identity checks on an object() sentinel in Python?","acceptedAnswer":{"@type":"Answer","text":"Deep-copying an object() instance creates a brand-new object, so an identity check like deepcopy(_MISSING) is _MISSING returns False. The same happens with a pickle round trip. This can silently corrupt data, for example causing a copied patch dictionary to write a meaningless object into a real field like an email address instead of leaving it untouched. Developers debugging copy or pickle identity bugs can follow python releases on daily.dev."}},{"@type":"Question","name":"How do you make a sentinel value picklable in Python 3.15?","acceptedAnswer":{"@type":"Answer","text":"A sentinel is picklable only when pickle can find it by module and name: at module level the sentinel's name argument must exactly match its variable name, and at class scope it must match the fully qualified name, such as sentinel('Config.AUTO') for a class attribute named AUTO. A mismatched name, a typo, or a sentinel local to a function will raise a PicklingError. daily.dev helps developers stay current on Python API details like sentinel pickling rules."}}]}
```

