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

Iterating through object returns more than limit. #38

Open
astranberg opened this issue Jan 1, 2020 · 0 comments
Open

Iterating through object returns more than limit. #38

astranberg opened this issue Jan 1, 2020 · 0 comments

Comments

@astranberg
Copy link

astranberg commented Jan 1, 2020

Hello,

Not sure what's happening but the object returned from get_top_clans seems to bug when iterated through. When I print the object, I get this single item I requested (limit=1). But when I iterate through it I get a near infinite loop of objects.

CODE

officialClient = clashroyale.official_api.Client(officialAPIToken)
lTopClans = officialClient.get_top_clans(limit=1)
print('Number of Clans:', len(lTopClans))
for i in lTopClans:
    print(i.tag)

EXPECTED:

Number of Clans: 1
#GYUQQCLV

ACTUAL:

Number of Clans: 1
#GYUQQCLV
#GYUQQCLV
#2CLV2RP0
#GYUQQCLV
#2CLV2RP0
#2GGR2GPQ0
#GYUQQCLV
#2CLV2RP0
#2GGR2GPQ0
#2LJ0ULYCC
#GYUQQCLV
#2CLV2RP0
#2GGR2GPQ0
#2LJ0ULYCC
#GUPYJ2

You'll see there's actually a pattern to it: it's returning like this:

item1
item1
item2
item1
item2
item3
item1
item2
item3
item4

But obviously, it was only supposed to return 1 item altogether.

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

1 participant