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 — [urllib] Add deprecated functions by donbarbos · Pull Request #14457 · python/typeshed

Conversation

@donbarbos

@donbarbos donbarbos commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

I think if they haven't been removed then they are still being used

Sorry, something went wrong.

Uh oh!

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

All reactions
@donbarbos
[urllib] Add deprecated function
d20c398
@donbarbos donbarbos changed the title [urllib] Add deprecated function [urllib] Add deprecated functions Jul 26, 2025
@github-actions

This comment has been minimized.

Sign in to view
@brianschubert

brianschubert commented Jul 26, 2025

Copy link
Copy Markdown
Collaborator

I think these are maybe better left out. From looking at the history, these are all undocumented functions that weren't meant to be exposed in Python 3:

  • https://docs.python.org/2.7/library/urllib.html#:~:text=urllib%20also%20exposes,helper%20functions
  • bpo-27485: Rename and deprecate undocumented functions in urllib.parse cpython#2205
All reactions

Sorry, something went wrong.

Uh oh!

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

@donbarbos
Add # undocumented comments
afd8535
@donbarbos

donbarbos commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

I think these are maybe better left out. From looking at the history, these are all undocumented functions that weren't meant to be exposed in Python 3:

In my view, these functions are still usable, as I don’t see any clear reason they wouldn’t be compatible with Python 3.x. Additionally, typeshed appears to be more of a reflection of the actual source code than a definitive source of documentation.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

All reactions

Sorry, something went wrong.

Uh oh!

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

@brianschubert

brianschubert commented Jul 26, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

As I understand it, these days typeshed's policy is that its generally open to adding undocumented and/or private symbols if they are requested or known to be useful, but generally doesn't try to add all such symbols just because they're present at runtime. Adding undocumented symbols can lead to IDEs suggesting them in autocomplete suggestions and generally can mislead users of type checkers and other tools into thinking that these symbols are/were part of the public API.

Do you happen to know if these functions are actually being used out in the wild? I tried doing a quick search of open source code for them, but I'm only seeing cases them being defined in vendored copies of urllib.

If these do get added to the stubs, I might suggest removing the @deprecated decorator. @deprecated suggests a change in level of support, but these functions were never documented / supported in Python 3. Python 3.8 is just when they started also raising a warning at runtime.

donbarbos, JelleZijlstra, and Akuli reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra

JelleZijlstra commented Jul 26, 2025

Copy link
Copy Markdown
Member

If these do get added to the stubs, I might suggest removing the @deprecated decorator. @deprecated suggests a change in level of support, but these functions were never documented / supported in Python 3. Python 3.8 is just when they started also raising a warning at runtime.

I don't agree with this: they raise DeprecationWarning at runtime, so adding @deprecated seems reasonable to me. They've just been deprecated for a long time.

brianschubert, AlexWaygood, and Akuli reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

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

@donbarbos

donbarbos commented Jul 26, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

I understand your point of view. However, I’m approaching this from the perspective that someone might still be using these functions. So I suggest we wait for the maintainer’s decision.

All reactions

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra

JelleZijlstra commented Jul 26, 2025

Copy link
Copy Markdown
Member

I'm a maintainer and I agree that we should only add these if someone comes to us and tells us they're actually using these functions.

AlexWaygood and Akuli reacted with thumbs up emoji donbarbos reacted with laugh emoji
All reactions
  • 👍 2 reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood

AlexWaygood commented Jul 26, 2025

Copy link
Copy Markdown
Member

I am also a maintainer and I agree with Jelle. The reason stubtest has never complained about these being missing from the stub is that they've been deliberately omitted from __all__ at runtime. I'm happy to add them if somebody actually has a use for them, but let's not just add them for completeness's sake :-)

donbarbos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood AlexWaygood closed this Jul 26, 2025
@donbarbos

donbarbos commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

I'm a maintainer and I agree that we should only add these if someone comes to us and tells us they're actually using these functions.

I didn't notice your message when I wrote and sent mine

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@donbarbos donbarbos mentioned this pull request Jul 28, 2025
[configparser] Add several deprecated attributes #14487
Merged
@donbarbos
donbarbos deleted the add-deprecated-functions-urllib branch February 25, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

4 participants

@donbarbos @brianschubert @JelleZijlstra @AlexWaygood
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.