praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
http://praw.readthedocs.io/
BSD 2-Clause "Simplified" License
3.51k stars 460 forks source link

reddit.subreddit.mod.removal_reasons isn't indexed in display order #1924

Closed computerologist closed 1 year ago

computerologist commented 1 year ago

Describe the Bug

reddit.subreddit.mod.removal_reasons isn't indexed in display order

Desired Result

reddit.subreddit.mod.removal_reasons should be indexed in display order

Relevant Logs

No response

Code to reproduce the bug

No response

My code example does not include the Reddit() initialization to prevent credential leakage.

Yes

This code has previously worked as intended.

Yes

Operating System/Environment

windows

Python Version

python 3.9.1

PRAW Version

7.4.0

Prawcore Version

2.3.0

Anything else?

No response

LilSpazJoekp commented 1 year ago

Could you elaborate or provide a code snippet showing how they aren't in order?

computerologist commented 1 year ago

Sure thing, although since grabbing these is a .mod action, you will need to replace the subreddit with one you moderate. Also it looks like it could be possible that they'd end up in order, but I am not seeing that happen on a reddit with 12 removal reasons. Misordering is consistent with new objects.

rrs = reddit.subreddit('yoursub').mod.removal_reasons

rrs[0].title # may not be the 0th index removal reason listed on reddit.com

# or just print em all out and compare to the list on reddit.com -- more likely to show mis-ordering

for rr in rrs:
    print(rr.title)
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

computerologist commented 1 year ago

Why would it be closed? It's still an issue.