]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Sat, 6 Jun 2026 12:47:33 +0000 (05:47 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2026 12:47:33 +0000 (05:47 -0700)
This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.

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: