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

Fix replacement of values in kwargs #37

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

cgrtrifork
Copy link
Contributor

@cgrtrifork cgrtrifork commented Mar 20, 2020

Related to issue #36.

Check if the value is a string, an iterable, or other, in that order (order is important, as a string is also an iterable). Then do the replacements.

>>> from stackapi import StackAPI
>>> site = StackAPI('stackoverflow')
>>> tag = 'java'
>>> period = 'month'
>>> site.fetch('tags/{tag}/top-answerers/{period}', tag=tag, period=period)
{'backoff': 0, 'has_more': False, 'page': 1, 'quota_max': 300, 'quota_remaining': 300, 'total': 0, 'items': [{'user': {'reputation': 8583, 'user_id': 10819573, 'user_type': 'registered', 'profile_im ...

…(order is important, as a string is also an iterable). Then do the replacements.
@AWegnerGitHub AWegnerGitHub merged commit 705c43f into AWegnerGitHub:master Mar 24, 2020
@AWegnerGitHub
Copy link
Owner

Thanks for the PR :) It looks good. I'll get it merged.

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

Successfully merging this pull request may close these issues.

2 participants