Sorry, something went wrong.
There was a problem hiding this comment.
I left some nitpicks. Also, please add tests.
Sorry, something went wrong.
| static int | ||
| pysqlite_row_contains(pysqlite_Row* self, PyObject *arg) | ||
| { | ||
| Py_ssize_t nitems, i; |
There was a problem hiding this comment.
Please use intermingled declarations :)
Sorry, something went wrong.
| for (i = 0; cmp == 0 && i < nitems; i++) { | ||
| cmp = PyObject_RichCompareBool( | ||
| arg, | ||
| PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0), |
There was a problem hiding this comment.
There's a lot happening on this line. I'd prefer it if you extracted these items before calling PyObject_RichCompareBool, for improved readability.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
|
@erlend-aasland Hmm, is this whole thing not wrong anyway? (See my comment in the issue thread.) |
Sorry, something went wrong.
|
Also, please add tests. I've added two doctests, aren't they enough? |
Sorry, something went wrong.
|
I've added two doctests, aren't they enough? If not, I don't know what is the best place for these tests. The doctests are there to make sure the examples in the docs actually work; it is not the place for unit tests. The unit tests (and regression tests, functional tests, etc.) all live in Lib/test/test_sqlite3. Their purpose is to test the _sqlite extension module (and the sqlite3 module) in all possible ways; we aim for as high code coverage as possible. If I want to check the code coverage of the _sqlite C code, I can do so easily with a couple of compiler/linker flags, running ./python.exe -m test test_sqlite3, and generate a report. Also, I'm not sure the buildbots run doctests; IIRC, they only run the test suite, but I might be wrong about this. |
Sorry, something went wrong.
|
Sure, @erlend-aasland, I've added a unit test :) |
Sorry, something went wrong.
|
Sure, @erlend-aasland, I've added a unit test :) Thanks! BTW; I haven't decided if this is a good thing to add, or not. But lets keep that conversation on the issue. I'm going to mark this with do-not-merge until the discussion has landed. |
Sorry, something went wrong.
|
I haven't decided if this is a good thing to add Should we open this to wider discussion on Discourse/Core development? |
Sorry, something went wrong.
|
Yeah, IMO it is worth it trying to gather more feedback on Discourse. |
Sorry, something went wrong.
I went ahead and added it :)
CC @erlend-aasland and @vsajip