Skip to content

[Documentation] Minor change: Unify indexes in Variance of generic types description #17871

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 1 commit into from
Jun 21, 2025

Conversation

hnykda
Copy link
Contributor

@hnykda hnykda commented Oct 3, 2024

This is a very minor fix.

The last comment in this code block:

my_circles: list[Circle] = []
add_one(my_circles)     # This may appear safe, but...
my_circles[-1].rotate()  # ...this will fail, since my_circles[0] is now a Shape, not a Circle

uses a different index 0 instead of the one used in the code -1. I think these should be same to avoid confusion. I went for 0.

@hauntsaninja hauntsaninja merged commit fabe37f into python:master Jun 21, 2025
2 checks passed
@hauntsaninja
Copy link
Collaborator

Thanks!

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