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
The list of standard generic collections is incomplete #86446
Comments
It looks like the documentation lists standard library collections that support parameterized generics[1] however, it seems to only feature a part of all the collections that support parametrizing (I'm going by the list that was produced by Ethan Smith[2], it could be slightly inaccurate now, but that can be cross-checked when making the contribution). I would be interested in making a PR adding these if/when this issue gets accepted. [1] https://docs.python.org/3.10/library/stdtypes.html#standard-generic-collections |
Dear Jack, good catch! My only worry is that if we make the list exhaustive, it would be too lengthy, or that it might not be feasible to continuously update it every time a new generic type supports the feature. Maybe a line somewhere to mention that most container types in Python should support the feature, and that the list provided is non-exhaustive should suffice? I'm not sure, nosy-ing Guido and Ivan to the list for their thoughts on this. |
I think the difference between the two lists is that not every generic type is a collection. If we apply that standard, I think the contextlib and re classes need to be *removed* from the list (did I get that right?). |
I was thinking that this could be the case but if I'm not mistaken, there's actually quite a lot of types in this list that aren't collections (awaitable, coroutine, iterable, iterator, generator, the async versions of those, callable, *hmm, are views collections?, and the ones you mentioned), so I figured that listing *only collections might have not been the intention when this was written. But listing all of the generics in Python would indeed be lengthy so it might make sense to limit it to collections nonetheless, I'm not really sure about it though. |
Let’s just close this, there are more important things to do. |
I concur with Guido to close this. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: