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-28754: AC on bisect. by JulienPalard · Pull Request #177 · python/cpython Conversation
|
| #include "Python.h" | ||
|
|
||
| static int | ||
| ssize_t_converter(PyObject *obj, void *ptr) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ssize_t_converter is not used for parsing arguments. It is used only in optional_ssize_t_converter. Wouldn't be better to inline it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| a: object | ||
| x: object | ||
| lo: Py_ssize_t(c_default='0') = 0 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
c_default='0' is redundant.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
|
|
||
| /*[clinic input] | ||
| bisect.bisect_right |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You can use the return converter for simplifying the code.
bisect.bisect_right -> Py_ssize_t
The body of bisect_bisect_right_impl() would be just:
return internal_bisect_right(a, x, lo, hi);
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| def test_hi_backcompatbility(self): | ||
| for func, data, elem, expected in self.precomputedCases: | ||
| self.assertEqual(func(data, elem, 0, -1), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This doesn't check that passing -1 and None is the same as not specifying the hi argument. Compare results with func(data, elem).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I don't want the pure python API to change at all. It is a long standing API and there is nothing wrong with it. Also, passing it -1 here as a special value makes real code less readable. Further, the change slightly slows down the case where high is specified. In a high performance building block module, we shouldn't add in unnecessary checks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
To try and help move older pull requests forward, we are going through and backfilling 'awaiting' labels on pull requests that are lacking the label. Based on the current reviews, the best we can tell in an automated fashion is that a core developer requested changes to be made to this pull request. If/when the requested changes have been made, please leave a comment that says, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ute() I missed the C-fame case, when I changed the frame-function ref counting in Stackless issue python#117.
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.