https://github.com/python/cpython/commit/884ac3e3ec02347301939ff1f124972d4973f015
commit: 884ac3e3ec02347301939ff1f124972d4973f015
branch: main
author: Jelle Zijlstra <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-06-06T05:47:33-07:00
summary:

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.

files:
M Lib/urllib/parse.py

diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index d64f678d235b6f9..82b95adbdc283ef 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", repr="<not specified>")
 _MISSING_AS_NONE_DEFAULT = False
 
 class _ResultBase:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to