Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer support for re #7679

Merged
merged 2 commits into from
Apr 24, 2022
Merged

Buffer support for re #7679

merged 2 commits into from
Apr 24, 2022

Conversation

JelleZijlstra
Copy link
Member

No description provided.

@JelleZijlstra
Copy link
Member Author

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

@github-actions
Copy link
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
Copy link
Collaborator

Akuli commented Apr 23, 2022

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

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

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

@JelleZijlstra
Copy link
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.)

@hauntsaninja
Copy link
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>
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.

None yet

3 participants