-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Cursor is not an Iterator #992
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
Comments
Currently, Cursor is an iterable, not an iterator. So missing But DB-API 2.0 says |
Thanks for your response! And yes, you're right, my bad. In this case Cursor is an iterable. However I can work with having also |
Please create a PR. |
@methane I couldn't find a contribution guidelines, I just upload a PR but please do not hesitate in point me if I need to follow a particular template or complete any additional docs EDIT: working on tests right now. |
Describe the bug
Trying to iterate over a set of results:
I get a:
TypeError: 'DictCursor' object is not an iterator
I think the problem is that
BaseCursor
implements__iter__
method and not the__next__
method, as the Python reference states: https://docs.python.org/3/glossary.html#term-iteratorI made a workaround:
And it works as expected.
I can upload a PR with that for review, what do you think?
The text was updated successfully, but these errors were encountered: