SubredditFilters¶
- class praw.models.reddit.subreddit.SubredditFilters(subreddit)¶
Provide functions to interact with the special
Subreddit’s filters.Members of this class should be utilized via
Subreddit.filters(). For example, to add a filter, run:reddit.subreddit("all").filters.add("test")
- Parameters:
subreddit (models.Subreddit)
- __init__(subreddit)¶
Initialize a
SubredditFiltersinstance.- Parameters:
subreddit (
Subreddit) – The special subreddit whose filters to work with.- Return type:
None
As of this writing filters can only be used with the special subreddits
allandmod.
- __iter__()¶
Iterate through the special
Subreddit’s filters.This method should be invoked as:
for subreddit in reddit.subreddit("test").filters: ...
- add(subreddit)¶
Add
subredditto the list of filtered subreddits.Items from subreddits added to the filtered list will no longer be included when obtaining listings for r/all.
Alternatively, you can filter a subreddit temporarily from a special listing in a manner like so:
reddit.subreddit("all-redditdev-learnpython")