]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612) (#151017)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Jun 2026 13:13:52 +0000 (15:13 +0200)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2026 13:13:52 +0000 (13:13 +0000)
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 <jelle.zijlstra@gmail.com>
Lib/urllib/parse.py

index d64f678d235b6f9d88cf75dde3cb0068bec22399..82b95adbdc283efc7e1910426502bbdb5105104e 100644 (file)
@@ -277,7 +277,7 @@ class _NetlocResultMixinBytes(_NetlocResultMixinBase, _ResultMixinBytes):
         return hostname, port
 
 
-_UNSPECIFIED = ['not specified']
+_UNSPECIFIED = sentinel("_UNSPECIFIED", repr="<not specified>")
 _MISSING_AS_NONE_DEFAULT = False
 
 class _ResultBase: