Skip to content

gh-105578: Raise DeprecationWarning on typing.AnyStr usage - #150190

Open
sobolevn wants to merge 7 commits into
python:mainfrom
sobolevn:issue-105578
Open

sobolevn wants to merge 7 commits into
python:mainfrom
sobolevn:issue-105578

Conversation

@sobolevn

@sobolevn sobolevn commented May 21, 2026 •

Copy link
Copy Markdown
Member

@read-the-docs-community

read-the-docs-community Bot commented May 21, 2026 •

Copy link
Copy Markdown

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Wow, that came around quickly.

I had to think this through again, but I think this is correct: this is a deprecation for Python 3.16, which will become stable in autumn 2027, around the same time that Python 3.11 goes end-of-life. That means that the deprecation warnings will start to be emitted at basically the same time that the lowest non-EOL Python version is Python 3.12 -- and Python 3.12 is the first version in which users can use PEP-695 syntax

Comment thread Doc/library/typing.rst Outdated
Comment thread Lib/typing.py Outdated
Comment thread Lib/typing.py Outdated
@AlexWaygood

Copy link
Copy Markdown
Member

the test failures from the deprecation warnings in setuptools in https://github.com/python/cpython/actions/runs/26230364757/job/77188896358?pr=150190 do seem a bit concerning. Do we need to update setuptools before landing this?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Aug 19, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 28, 2026
@sobolevn

sobolevn commented Oct 28, 2026 •

Copy link
Copy Markdown
Member Author

Setuptools is updated, new version is released. I've fixed all merge conflicts.

Comment thread Lib/typing.py Outdated
Comment thread Doc/deprecations/pending-removal-in-3.18.rst Outdated
@sobolevn sobolevn removed the stale Stale PR or inactive for long period of time. label Oct 28, 2026
Comment thread Doc/deprecations/pending-removal-in-3.18.rst Outdated
Comment thread Lib/test/test_typing.py Outdated
@sobolevn

Copy link
Copy Markdown
Member Author

We can address the setuptools.whl tests failures in two ways:

  1. We can update the bundled .whl to a newer version
  2. Or we can add warnings ignore guards

I think that both have their downsides, but I would probably go with 1 :)

Comment thread Doc/deprecations/pending-removal-in-3.21.rst Outdated
Comment thread Lib/typing.py Outdated
Comment thread Lib/typing.py Outdated
Comment thread Lib/typing.py Outdated
Comment thread Misc/NEWS.d/next/Library/2026-05-21-16-15-01.gh-issue-105578.oq-0pg.rst Outdated
sobolevn and others added 2 commits October 28, 2026 14:51
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@sobolevn

Copy link
Copy Markdown
Member Author

I created #160824 to discuss the setuptools update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants