Skip to content

[re] Add union fallback overload for escape - #16745

Merged
srittau merged 2 commits into
python:mainfrom
bschnurr:fix/pyright-pr11970-feedback
Nov 12, 2026
Merged

srittau merged 2 commits into
python:mainfrom
bschnurr:fix/pyright-pr11970-feedback

Conversation

@bschnurr

@bschnurr bschnurr commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Add a final str | ReadableBuffer overload for re.escape so nullable-input diagnostics identify the unsupported None member rather than blaming a supported str value, while preserving existing string, buffer, AnyStr, and Any inference.

CPython implementation.

Prepared with GitHub Copilot (GPT-6.1 Sol).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@srittau
srittau merged commit 80f7bea into python:main Nov 12, 2026
88 checks passed
bschnurr added a commit to bschnurr/pyright that referenced this pull request Nov 12, 2026
Includes python/typeshed#16745, fixing nullable re.escape diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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