-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-128335: Make slice generic at runtime #128336
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
6baf878
61fbf37
f241643
112d407
60a9c08
b8b2d20
ba15ed9
7a95cc9
c7991b3
4da9842
21e8ee8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Make slice type subscriptable at runtime | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -560,6 +560,7 @@ static PyMethodDef slice_methods[] = { | |
METH_O, slice_indices_doc}, | ||
{"__reduce__", (PyCFunction)slice_reduce, | ||
METH_NOARGS, reduce_doc}, | ||
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, "See PEP 585"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This docstring seems misleading, as PEP 585 doesn't mention the (Maybe PEP 585 could refer to https://typing.readthedocs.io/en/latest/guides/modernizing.html#generics-in-the-typing-module? Right now it links to documentation for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed it is maybe a little silly to be putting PEPs in these things when they aren't active docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PRs to the PEPs repo improving things like this are welcome! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do agree that our docstrings probably also shouldn't be referencing PEPs, which are, as you both note, historical documents recording decisions that were made at one point in time rather than living documentation. But all the other |
||
{NULL, NULL} | ||
}; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.