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

unsupported operand type(s) for +=: 'dict' and 'dict' #32

Closed
liZe opened this issue Mar 31, 2016 · 3 comments
Closed

unsupported operand type(s) for +=: 'dict' and 'dict' #32

liZe opened this issue Mar 31, 2016 · 3 comments

Comments

@liZe
Copy link
Contributor

liZe commented Mar 31, 2016

The Search API provides a multi-page search, but returns dicts (and not lists), leading to an error. That's the only multi-page dict I've found in the API.

A quick fix would be to use something like that in request:

body = response.json()
if isinstance(body, list):
    result += body
elif isinstance(body, dict) and 'items' in body:
    result['items'] += body['items']

Any better ideas?

@cenkalti
Copy link
Owner

cenkalti commented Apr 4, 2016

LGTM. I would merge it if you make a PR.

@liZe
Copy link
Contributor Author

liZe commented May 2, 2016

@cenk Done!

@cenkalti
Copy link
Owner

cenkalti commented May 6, 2016

Thank you. I have updated the version on PyPI: https://pypi.python.org/pypi/GitHub-Flask/3.1.2

@cenkalti cenkalti closed this as completed May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants