diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index d64f678d235b6f..2760772390baaa 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -277,7 +277,7 @@ def _hostinfo(self): return hostname, port -_UNSPECIFIED = ['not specified'] +_UNSPECIFIED = sentinel("_UNSPECIFIED") _MISSING_AS_NONE_DEFAULT = False class _ResultBase: diff --git a/Misc/NEWS.d/next/Library/2026-05-09-10-50-00.gh-issue-149083.56s2W-.rst b/Misc/NEWS.d/next/Library/2026-05-09-10-50-00.gh-issue-149083.56s2W-.rst new file mode 100644 index 00000000000000..d9c2fa85b5d8a7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-05-09-10-50-00.gh-issue-149083.56s2W-.rst @@ -0,0 +1,2 @@ +The private ``_UNSPECIFIED`` sentinel in :mod:`urllib.parse` is now an +instance of :class:`sentinel`.