GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects by AlexWaygood · Pull Request #29479 · python/cpython Conversation
|
|
@JelleZijlstra, reckon this can be merged soon? :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looking at this again I'm not so sure, sorry. This adds more text than was there before, but the new text is a little repetitive. I do like the additional links though. I feel like a broader problem with the language reference is that it veers too much into describing how concrete built-in types handle an operation, and not enough into how exactly the operation works. Here, for example, there is no precise description of when |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
See also bpo-46754. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks for taking a look! I'll have a think tomorrow about whether I want to try revising this PR, or just close it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Perhaps you're right that that information might be better found in this document, but tbqh I don't have the energy to move that section from the data model to here after spending so long adding that section to the data model in GH-29389 :( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@JelleZijlstra I've had another bash at it. I've tried to make the section less repetitive and increase the accuracy of the section regarding the "expression list". The core aims of this PR are to:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just one comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Subscription of a sequence (string, tuple or list) or mapping (dictionary) | ||
| object usually selects an item from the collection: | ||
| The subscription of an instance of a :ref:`container class <sequence-types>` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Seems weird to link this to sequence types. Maybe just drop the link? The later explanation is clearer about sequences and mappings.
| The subscription of an instance of a :ref:`container class <sequence-types>` | |
| The subscription of an instance of a container class |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think the section in the docs linked to with sequence-types perhaps originally only discussed sequence types. Now, however, it discusses all kinds of container types -- the link takes us to here: https://docs.python.org/3/reference/datamodel.html#emulating-container-types
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm happy to merge this now (cc @gvanrossum).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
(Because the other meaning of "subscription" (e.g. a magazine) is so much more common I have a slight problem with using it to refer to the a[i] syntax, but it seems commonly used in our docs so it's fine. And the unambiguous alternative, "subscripting", is used much less frequently in our docs.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @AlexWaygood for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-31743 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-31744 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
pythonGH-29479) (cherry picked from commit 5073129) Co-authored-by: Alex Waygood <[email protected]>
pythonGH-29479) (cherry picked from commit 5073129) Co-authored-by: Alex Waygood <[email protected]>
pythonGH-29479) (cherry picked from commit 5073129) Co-authored-by: Alex Waygood <[email protected]>
GH-29479) (cherry picked from commit 5073129) Co-authored-by: Alex Waygood <[email protected]>
|
Thanks so much for helping get this over the line @JelleZijlstra! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
pythonGH-29479) (cherry picked from commit 5073129) Co-authored-by: Alex Waygood <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.