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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hnykda
Copy link

@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.

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.

1 participant