Skip to content
TORNLIFE More

Small error in api returns

Started by cazylecious [2673048] on in API Development.

2 replies · 116 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
3
Discussion span
→
People posting
2
Likes on archived posts
0
Authority score
50 / 100
Historical score
18 / 100
Story score
22 / 100
Engagement score
40 / 100
cazylecious [2673048]
[image: media.discordapp.net]
As you can see, in the https://www.torn.com/api.html# page, when I look up faction/chains, my first result in the chains dictionary is '5996'
but, if I attempt the code myself in an IDE:
[image: cdn.discordapp.com]
The '5996' chain is at the end, and the one at the end in the torn API page is at the beginning
This isn't really very important, nor do I know if it's a problem on my end or something, but it wouldn't hurt to correct whatever is messing it up for the sake of consistency.
Please correct me if I'm making some stupid mistake somewhere^^
Stiny [992186]
Python automatically sorts the keys of a dictionary so it's putting it at the end for you by default since it's the lowest.
cazylecious [2673048]
By that definition, the properties call should be sorted differently as well; however, the keys sorting in the docs and python is the same for properties, while it's reversed for chains.
[image: media.discordapp.net]
API docs being sorted in ascending order^.
[image: media.discordapp.net]
And this is python being sorted in ascending order as well

Python in the chains call was sorted in the descending order, therefore, to me, I don't find any correlation between the sorting in python