Skip to content

Iterating through object returns more than limit. #38

@astranberg

Description

@astranberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions