← 返回首页
Buffer support for re by JelleZijlstra · Pull Request #7679 · python/typeshed · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Buffer support for re#7679

Merged
JelleZijlstra merged 2 commits into
python:masterfrom
JelleZijlstra:pickle
Apr 24, 2022
Merged

Buffer support for re#7679
JelleZijlstra merged 2 commits into
python:masterfrom
JelleZijlstra:pickle

Conversation

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

Also showed up in python/mypy#12661. Replaces #7158.

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

paroxython (https://github.com/laowantong/paroxython) + paroxython/map_taxonomy.py:223: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "TaxonName" core (https://github.com/home-assistant/core) + homeassistant/components/huawei_lte/device_tracker.py:170: error: On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc"; use "{!r}" if this is desired behavior [str-bytes-safe]

Akuli commented Apr 23, 2022

Copy link
Copy Markdown
Collaborator

Maybe we should update the third-party regex stubs too.

hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Thanks! The homeassistant one looks like a false positive to me, probably a mypy bug, although we should be able to work around it if we wanted by using self types for Match.group

Copy link
Copy Markdown
Member Author

@Akuli sure, I'll do that in a separate PR.

@hauntsaninja yes that one is weird to me. Not sure where mypy gets bytes from in this code: https://github.com/home-assistant/core/blob/859dcb396a6f7a1712a188fc67060019aea24e9c/homeassistant/components/huawei_lte/device_tracker.py#L170. I don't understand how self types would help either.

(Also, the paroxython one looks like a true positive. I don't know why mypy didn't catch it before.)

Copy link
Copy Markdown
Collaborator

I filed python/mypy#12666 for it

JelleZijlstra added a commit to JelleZijlstra/typeshed that referenced this pull request Apr 24, 2022
JelleZijlstra added a commit that referenced this pull request May 10, 2022
Similar to #7679 Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Akuli <akuviljanen17@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants

Footer

© 2026 GitHub, Inc.