praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

Home Page:http://praw.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

computerologist opened this issue · comments

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

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

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)

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.

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