Listing¶
Listings represent arrays returned by the Reddit API. It knows the Reddit
instance it’s working for,
and contains references to Subreddit
and Submission
if available
which are injected to the dynamically parsed aPRAW models.
Raw listings can be fetched with the get_listing()
method where the endpoint needs to be supplied,
and returns a listing.
- class apraw.models.Listing(reddit: Reddit, data: Dict, kind_filter: List[str] = None, subreddit: Subreddit = None, link_id: str = '')¶
A model representing Reddit listings.
- __getitem__(index: int) apraw.models.helpers.apraw_base.aPRAWBase ¶
Return the item at position index in the list.
- Parameters
index (int) – The item’s index.
- Returns
item – The searched item.
- Return type
- __iter__() Iterator[apraw.models.helpers.apraw_base.aPRAWBase] ¶
Permit Listing to operate as an iterator.
- Returns
self – The iterator.
- Return type
- __len__() int ¶
Return the number of items in the Listing.
- Returns
len – The number of items in the listing.
- Return type
int
- __next__() apraw.models.helpers.apraw_base.aPRAWBase ¶
Permit Listing to operate as a generator.
- Returns
item – The next item in the listing.
- Return type