GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-149083: Use sentinel for urllib.parse._UNSPECIFIED by JelleZijlstra · Pull Request #149612 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 9, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.

Since it's new in 3.15, I think it's fine to apply the change to both 3.15 and main (cc @hugovk). I added a NEWS entry out of an abundance of caution.

  • Issue: Use PEP 661 (sentinels) in the standard library #149083

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk and serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@JelleZijlstra
pythongh-149083: Use sentinel for urllib.parse._UNSPECIFIED
b684249
This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
@JelleZijlstra JelleZijlstra added the needs backport to 3.15 bugs and security fixes label May 9, 2026
@bedevere-app bedevere-app Bot added the awaiting core review label May 9, 2026
@bedevere-app bedevere-app Bot mentioned this pull request May 9, 2026
Use PEP 661 (sentinels) in the standard library #149083
Open
@JelleZijlstra
JelleZijlstra requested a review from serhiy-storchaka May 9, 2026 17:54
serhiy-storchaka
serhiy-storchaka reviewed May 9, 2026
View reviewed changes
Comment thread Lib/urllib/parse.py Outdated


_UNSPECIFIED = ['not specified']
_UNSPECIFIED = sentinel("_UNSPECIFIED")

@serhiy-storchaka serhiy-storchaka May 9, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not it look better in the help if use "<not specified>" as a name? This sentinel is not intended to be pickled or used by user. It is just a placeholder for the case when the user has not specified the argument.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JelleZijlstra JelleZijlstra May 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the repr= argument now that we have it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Library/2026-05-09-10-50-00.gh-issue-149083.56s2W-.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra added 2 commits May 22, 2026 07:47
@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into parse-unspec
32afa01
@JelleZijlstra
use repr=, remove NEWS
2c9848a
@JelleZijlstra JelleZijlstra added the skip news label May 22, 2026
@JelleZijlstra JelleZijlstra mentioned this pull request Jun 6, 2026
Type annotations in _colorize module are unresolvable at runtime #150994
Closed
@JelleZijlstra
JelleZijlstra merged commit 884ac3e into python:main Jun 6, 2026
51 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 6, 2026

Copy link
Copy Markdown

Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 6, 2026
@bedevere-app

bedevere-app Bot commented Jun 6, 2026

Copy link
Copy Markdown

GH-151017 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 6, 2026
JelleZijlstra added a commit that referenced this pull request Jun 6, 2026
@miss-islington @JelleZijlstra
[3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612…
9352936
…) (#151017)

This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
(cherry picked from commit 884ac3e)

Co-authored-by: Jelle Zijlstra <[email protected]>
philthompson10 pushed a commit to philthompson10/cpython that referenced this pull request Jun 17, 2026
@JelleZijlstra @philthompson10
pythongh-149083: Use sentinel for urllib.parse._UNSPECIFIED (python#1…
e4308c5
…49612)

This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JelleZijlstra @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.