From e13c3d643e508f201a5bcd2e522d4acf6c93f4fe Mon Sep 17 00:00:00 2001 From: Sanghun Lee Date: Mon, 17 Aug 2026 12:51:28 +0900 Subject: [PATCH 1/2] gh-149083: Document that dataclasses.MISSING and KW_ONLY are sentinels (#155919) Co-authored-by: Claude Opus 5 (1M context) --- Doc/library/dataclasses.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index ce59d89843e761d..9f4871a55bc8af3 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -262,8 +262,8 @@ Module contents c = C() c.mylist += [1, 2, 3] - As shown above, the :const:`MISSING` value is a sentinel object used to - detect if some parameters are provided by the user. This sentinel is + As shown above, the :const:`MISSING` value is a :class:`sentinel` object + used to detect if some parameters are provided by the user. This sentinel is used because ``None`` is a valid value for some parameters with a distinct meaning. No code should directly use the :const:`MISSING` value. @@ -528,11 +528,14 @@ Module contents .. data:: MISSING - A sentinel value signifying a missing default or default_factory. + A :class:`sentinel` object signifying a missing default or *default_factory*. + + .. versionchanged:: 3.15 + :const:`!MISSING` is now a :class:`sentinel` object. .. data:: KW_ONLY - A sentinel value used as a type annotation. Any fields after a + A :class:`sentinel` object used as a type annotation. Any fields after a pseudo-field with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely ignored. This includes the @@ -557,6 +560,9 @@ Module contents .. versionadded:: 3.10 + .. versionchanged:: 3.15 + :const:`!KW_ONLY` is now a :class:`sentinel` object. + .. exception:: FrozenInstanceError Raised when an implicitly defined :meth:`~object.__setattr__` or From e3910521029a04b7ec4432fdbdc01458fb7fc863 Mon Sep 17 00:00:00 2001 From: cmw0213 <142071629+cmw0213@users.noreply.github.com> Date: Mon, 17 Aug 2026 13:13:08 +0900 Subject: [PATCH 2/2] gh-155917: Narrow bare except in email._header_value_parser.get_parameter (gh-155916) --- Lib/email/_header_value_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index 792072ab9f6128a..7c03fb49b3b5e77 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2537,7 +2537,7 @@ def get_parameter(value): else: try: token, rest = get_extended_attrtext(inner_value) - except: + except errors.HeaderParseError: pass else: if not rest: