From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 6 Jun 2026 13:13:52 +0000 (+0200) Subject: [3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612) (#151017) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9352936b4ec21a0237df09a8e416dca2401d7921;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612) (#151017) This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object. (cherry picked from commit 884ac3e3ec02347301939ff1f124972d4973f015) Co-authored-by: Jelle Zijlstra --- 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: