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

bpo-30537: use PyNumber in itertools.islice instead of PyLong #1918

Merged
merged 3 commits into from
Jun 8, 2017

Conversation

wroberts
Copy link
Contributor

@wroberts wroberts commented Jun 2, 2017

Taking a stab at addressing bpo-30537; replace PyLong_AsSsize_t in itertools with PyNumber_AsSsize_t.

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@wroberts
Copy link
Contributor Author

wroberts commented Jun 2, 2017

Request re-check of CLA (I have signed and should be verified)

@wroberts wroberts force-pushed the bpo-30537-itertools-use-pynumber branch from 82fd551 to 4c73e4d Compare June 2, 2017 17:41
@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Jun 3, 2017
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed tests and an entry in Misc/NEWS.

@@ -3072,11 +3072,11 @@ permutations_new(PyTypeObject *type, PyObject *args, PyObject *kwds)

r = n;
if (robj != Py_None) {
if (!PyLong_Check(robj)) {
PyErr_SetString(PyExc_TypeError, "Expected int as r");
if (!PyNumber_Check(robj)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use PyIndex_Check.

@wroberts wroberts changed the title bpo-30537: use PyNumber in itertools instead of PyLong bpo-30537: use PyNumber in itertools.islice instead of PyLong Jun 6, 2017
@rhettinger rhettinger merged commit 0ecdc52 into python:master Jun 8, 2017
@wroberts wroberts deleted the bpo-30537-itertools-use-pynumber branch June 8, 2017 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants