From: Jelle Zijlstra Date: Sat, 6 Jun 2026 12:47:33 +0000 (-0700) Subject: gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=884ac3e3ec02347301939ff1f124972d4973f015;p=thirdparty%2FPython%2Fcpython.git gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612) This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object. --- diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index d64f678d235b..82b95adbdc28 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -277,7 +277,7 @@ class _NetlocResultMixinBytes(_NetlocResultMixinBase, _ResultMixinBytes): return hostname, port -_UNSPECIFIED = ['not specified'] +_UNSPECIFIED = sentinel("_UNSPECIFIED", repr="") _MISSING_AS_NONE_DEFAULT = False class _ResultBase: