Skip to content

Use SupportsIndex where applicable for 4 classes in builtins.pyi #5694

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

Merged
merged 3 commits into from
Jun 26, 2021

Conversation

BvB93
Copy link
Contributor

@BvB93 BvB93 commented Jun 26, 2021

A bit of a follow up on #5228.

The changes affect the following four classes:

  • str
  • bytes
  • bytearray
  • memoryview

* `str`
* `bytes`
* `bytearray`
* `memoryview`
@BvB93 BvB93 changed the title Use SupportsIndex where applicable for 4 classes builtins.pyi Use SupportsIndex where applicable for 4 classes in builtins.pyi Jun 26, 2021
@github-actions

This comment has been minimized.

@Akuli
Copy link
Collaborator

Akuli commented Jun 26, 2021

You will also need to fix class Markup in stubs/MarkupSafe/markupsafe/__init__.pyi. It seems to pass arguments to str, so it can use SupportsIndex whenever str uses SupportsIndex.

@github-actions
Copy link
Contributor

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

@Akuli Akuli merged commit 50f5858 into python:master Jun 26, 2021
@BvB93 BvB93 deleted the index branch June 26, 2021 16:07
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