[issue42010] Generic types accept indexing/subscripting, causing confusion

Guido van Rossum report at bugs.python.org
Mon Oct 12 19:22:52 EDT 2020


Guido van Rossum <guido at python.org> added the comment:

Have you observed actual users getting confused by this? (E.g. StackOverflow or mailing list posts.) I would assume that if you try to *do* anything with the resulting object it's going to cause a traceback, and from there it's pretty straightforward to debug the situation. (Maybe not for absolute beginners, but they have a lot of ways to confuse themselves. :-)

There are people working on proposals for "integer variadics" that would actually give meaning to things like list[10] (or at least to A[10] and A[N, M] where A is a tensor type) so I am reluctant to forbid this now -- we might have to allow it in the next release.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42010>
_______________________________________


More information about the Python-bugs-list mailing list