Skip to content

Remove typing.AnyStr usage#5232

Open
sobolevn wants to merge 1 commit into
pypa:mainfrom
sobolevn:remove-AnyStr
Open

Remove typing.AnyStr usage#5232
sobolevn wants to merge 1 commit into
pypa:mainfrom
sobolevn:remove-AnyStr

Conversation

@sobolevn
Copy link
Copy Markdown

@sobolevn sobolevn commented May 21, 2026

Summary of changes

Hi 👋
We are deprecating AnyStr with a warning since Python 3.16, this is a proactive PR to replace it with a modern alternative.
Context python/cpython#150190

Pull Request Checklist

This is not really a user-facing change (at least it should not be), so no changelog entries.

@Avasam
Copy link
Copy Markdown
Contributor

Avasam commented May 27, 2026

Thanks @sobolevn ! Note that any change to the _distutils folder has to be done there: https://github.com/pypa/distutils or it'll get ovewritten next sync

Since this won't be immediately marked as deprecated, I'm tempted to recommend to this project's maintainers to use https://docs.astral.sh/ruff/rules/banned-api/ / https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_banned-api to prevent accidentally adding it back.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants