Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stub files for PRAW #1164

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d66f40f
Add stub templates for praw
PythonCoderAS Dec 22, 2019
b1ab320
Add stubs for praw/config.py
PythonCoderAS Dec 23, 2019
5a4c85a
Add stubs for praw/const.py
PythonCoderAS Dec 23, 2019
0a28dd2
Stub praw/exceptions.py
PythonCoderAS Dec 23, 2019
e123b13
commit other blank stubs
PythonCoderAS Dec 23, 2019
1625447
Finish stub for praw/objector.py
PythonCoderAS Dec 23, 2019
d4966c3
Add more dict
PythonCoderAS Dec 23, 2019
b939d91
Add more checks
PythonCoderAS Dec 23, 2019
044704e
Add stub for reddit and remove private methods
PythonCoderAS Dec 23, 2019
5138f70
Reformat reddit
PythonCoderAS Dec 23, 2019
f0a152d
Reduce redundancies
PythonCoderAS Dec 23, 2019
c5a437f
Stub praw/util/cache
PythonCoderAS Dec 23, 2019
8df94da
Stub praw/util/__init__
PythonCoderAS Dec 23, 2019
a120cb8
Stub praw/models/auth
PythonCoderAS Dec 23, 2019
b978670
Stub praw/models/base
PythonCoderAS Dec 23, 2019
368f92c
Stub praw/models/comment_forest
PythonCoderAS Dec 23, 2019
5b8de51
Stub praw/models/front
PythonCoderAS Dec 23, 2019
deaf093
Stub praw/models/helpers
PythonCoderAS Dec 23, 2019
f8ae34d
Stub praw/models/inbox
PythonCoderAS Dec 23, 2019
f67d82f
Stub praw/models/modaction
PythonCoderAS Dec 23, 2019
7dc7522
Stub praw/models/preferences
PythonCoderAS Dec 23, 2019
f060016
Stub praw/models/redditors
PythonCoderAS Dec 23, 2019
86b6cfb
Stub praw/models/stylesheet
PythonCoderAS Dec 23, 2019
ae5d7b2
Stub praw/models/subreddits
PythonCoderAS Dec 23, 2019
1d62623
Stub praw/models/trophy
PythonCoderAS Dec 23, 2019
e5367da
Stub praw/models/user
PythonCoderAS Dec 23, 2019
240ec89
Stub praw/models/util
PythonCoderAS Dec 23, 2019
15bc0e0
Stub praw/models/base
PythonCoderAS Dec 23, 2019
a0fcc79
Stub praw/models/listing/domain and revise praw/models/listing/base
PythonCoderAS Dec 23, 2019
01763f4
Stub praw/models/listing/generator
PythonCoderAS Dec 23, 2019
2793ddd
Stub praw/models/listing/listing
PythonCoderAS Dec 23, 2019
b7bd791
Stub praw/models/listing/mixins/base
PythonCoderAS Dec 23, 2019
b55fbe1
Stub praw/models/listing/mixins/gilded
PythonCoderAS Dec 23, 2019
adc5cb7
Stub praw/models/listing/mixins/reddutir
PythonCoderAS Dec 23, 2019
5f56eb8
Stub praw/models/listing/mixins/rising
PythonCoderAS Dec 23, 2019
1b39dd3
Stub praw/models/listing/mixins/submission
PythonCoderAS Dec 23, 2019
774156c
Stub praw/models/listing/mixins/subreddit and implement ListingGenera…
PythonCoderAS Dec 23, 2019
2cd3aa3
Expand on Generator and Collections
PythonCoderAS Dec 23, 2019
2acc6e7
Stub praw/models/reddit/base
PythonCoderAS Dec 23, 2019
cbd1e65
Stub praw/models/reddit/collections
PythonCoderAS Dec 23, 2019
a6c597d
Stub praw/models/reddit/comment
PythonCoderAS Dec 23, 2019
138ce56
remove blank
PythonCoderAS Dec 23, 2019
938362b
Stub praw/models/reddit/emoji
PythonCoderAS Dec 23, 2019
69da8a0
Fix checks on pre_push and .travis.yml
PythonCoderAS Dec 23, 2019
df7303f
Stub praw/models/reddit/live
PythonCoderAS Dec 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
_build/
build/
dist/
venv/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- install: pip install black flake8 pydocstyle sphinx sphinx_rtd_theme .
python: 3.8
script:
- black --check --verbose *.py docs praw tests
- black --check --verbose docs praw tests stubs ./pre_push.py setup.py
- flake8 --exclude=.eggs,build,docs
- pydocstyle praw
- sphinx-build -W docs/ /tmp/foo
Expand Down
4 changes: 3 additions & 1 deletion pre_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def run_static():
Otherwise, it will return statuscode 1
"""
success = True
success &= do_process(["black *.py docs praw tests"], shell=True)
success &= do_process(
["black docs praw tests stubs ./pre_push.py setup.py"], shell=True
)
success &= do_process(["flake8", "--exclude=.eggs,build,dist,docs,.tox"])
success &= do_process(["pydocstyle", "praw"])
# success &= do_process(["pylint", "--rcfile=.pylintrc", "praw"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tool.black]
exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)/'
exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|__pycache__)/'
line-length = 79
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""praw setup.py"""

import pathlib
import re
from codecs import open
from os import path
from setuptools import find_packages, setup
from os import fspath, path

from setuptools import find_packages, setup

PACKAGE_NAME = "praw"
HERE = path.abspath(path.dirname(__file__))
Expand All @@ -13,7 +13,6 @@
with open(path.join(HERE, PACKAGE_NAME, "const.py"), encoding="utf-8") as fp:
VERSION = re.search('__version__ = "([^"]+)"', fp.read()).group(1)


setup(
name=PACKAGE_NAME,
author="Bryce Boe",
Expand Down Expand Up @@ -49,7 +48,9 @@
keywords="reddit api wrapper",
license="Simplified BSD License",
long_description=README,
package_data={"": ["LICENSE.txt"], PACKAGE_NAME: ["*.ini"]},
package_data={"": ["LICENSE.txt"],
PACKAGE_NAME: ["*.ini"] + [fspath(file) for file in pathlib.Path(
path.abspath(path.join(__file__, "..", "stubs"))).glob('**/*.pyi')]},
packages=find_packages(exclude=["tests", "tests.*"]),
setup_requires=["pytest-runner >=2.1"],
tests_require=[
Expand Down
8 changes: 8 additions & 0 deletions stubs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Stub files
==========

These stub files show the types associated with the functions and methods of PRAW.
They need to be loaded with a type checker, which is included in most Python IDEs directly or as a plugin.

The stub files are in the same path structure as praw itself,
with one stub corresponding to one module.
1 change: 1 addition & 0 deletions stubs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Holds PRAW stubs"""
1 change: 1 addition & 0 deletions stubs/praw/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

29 changes: 29 additions & 0 deletions stubs/praw/config.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from configparser import RawConfigParser
from threading import Lock

from typing import Any, ClassVar, Dict, Optional, Union, TypeVar

_T = TypeVar("_T")

class Config:
CONFIG: ClassVar[Optional[RawConfigParser]] = ...
CONFIG_NOT_SET: ClassVar[_T] = ...
LOCK: ClassVar[Lock] = ...

@property
def short_url(self) -> Union[str, _T]: ...

custom: Dict[Union[str, Any], Union[str, Any]] = ...
client_id: ClassVar[Optional[str]] = ...
client_secret: ClassVar[Optional[str]] = ...
oauth_url: ClassVar[Optional[str]] = ...
reddit_url: ClassVar[Optional[str]] = ...
refresh_token: ClassVar[Optional[str]] = ...
redirect_uri: ClassVar[Optional[str]] = ...
password: ClassVar[Optional[str]] = ...
user_agent: ClassVar[Optional[str]] = ...
username: ClassVar[Optional[str]] = ...

def __init__(self, site_name: str, **settings: Union[str, Any]) -> Config: ...
check_for_updates: ClassVar[bool] = ...
kinds: ClassVar[Dict[str, Any]] = ...
7 changes: 7 additions & 0 deletions stubs/praw/const.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__version__: str
USER_AGENT_FORMAT: str
MAX_IMAGE_SIZE: int
MIN_JPEG_SIZE: int
MIN_PNG_SIZE: int
JPEG_HEADER: bytes
PNG_HEADER: bytes
3 changes: 3 additions & 0 deletions stubs/praw/endpoints.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Dict

API_PATH: Dict[str, str]
12 changes: 12 additions & 0 deletions stubs/praw/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import ClassVar


class PRAWException(Exception): ...

class APIException(PRAWException):
error_type: ClassVar[str] = ...
message: ClassVar[str] = ...
field: ClassVar[str] = ...
def __init__(self, error_type: str, message: str, field: str) -> APIException: ...

class ClientException(PRAWException): ...
30 changes: 30 additions & 0 deletions stubs/praw/models/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from .auth import Auth as Auth
from .front import Front as Front
from .helpers import LiveHelper as LiveHelper, MultiredditHelper as MultiredditHelper, SubredditHelper as SubredditHelper
from .inbox import Inbox as Inbox
from .list.redditor import RedditorList as RedditorList
from .list.trophy import TrophyList as TrophyList
from .listing.domain import DomainListing as DomainListing
from .listing.generator import ListingGenerator as ListingGenerator
from .listing.listing import Listing as Listing
from .modaction import ModAction as ModAction
from .preferences import Preferences as Preferences
from .reddit.collections import Collection as Collection
from .reddit.comment import Comment as Comment
from .reddit.emoji import Emoji as Emoji
from .reddit.live import LiveThread as LiveThread, LiveUpdate as LiveUpdate
from .reddit.message import Message as Message, SubredditMessage as SubredditMessage
from .reddit.modmail import ModmailAction as ModmailAction, ModmailConversation as ModmailConversation, ModmailMessage as ModmailMessage
from .reddit.more import MoreComments as MoreComments
from .reddit.multi import Multireddit as Multireddit
from .reddit.redditor import Redditor as Redditor
from .reddit.removal_reasons import RemovalReason as RemovalReason
from .reddit.submission import Submission as Submission
from .reddit.subreddit import Subreddit as Subreddit
from .reddit.widgets import Button as Button, ButtonWidget as ButtonWidget, Calendar as Calendar, CommunityList as CommunityList, CustomWidget as CustomWidget, IDCard as IDCard, Image as Image, ImageData as ImageData, ImageWidget as ImageWidget, Menu as Menu, MenuLink as MenuLink, ModeratorsWidget as ModeratorsWidget, PostFlairWidget as PostFlairWidget, RulesWidget as RulesWidget, Submenu as Submenu, SubredditWidgets as SubredditWidgets, SubredditWidgetsModeration as SubredditWidgetsModeration, TextArea as TextArea, Widget as Widget, WidgetModeration as WidgetModeration
from .reddit.wikipage import WikiPage as WikiPage
from .redditors import Redditors as Redditors
from .stylesheet import Stylesheet as Stylesheet
from .subreddits import Subreddits as Subreddits
from .trophy import Trophy as Trophy
from .user import User as User
12 changes: 12 additions & 0 deletions stubs/praw/models/auth.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import Optional, Union, Dict, Sequence, NoReturn, Set

from .base import PRAWBase as PRAWBase


class Auth(PRAWBase):
@property
def limits(self) -> Dict[str, Optional[Union[str, int]]]: ...
def authorize(self, code: str) -> Optional[str]: ...
def implicit(self, access_token: str, expires_in: int, scope: str) -> NoReturn: ...
def scopes(self) -> Set[str]: ...
def url(self, scopes: Sequence[str], state: str, duration: str = ..., implicit: bool = ...) -> str: ...
9 changes: 9 additions & 0 deletions stubs/praw/models/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import Any, Dict

from ..reddit import Reddit


class PRAWBase:
@classmethod
def parse(cls, data: Dict[Any, Any], reddit: Reddit): ...
def __init__(self, reddit: Reddit, _data: Dict[Any, Any]) -> PRAWBase: ...
13 changes: 13 additions & 0 deletions stubs/praw/models/comment_forest.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from typing import Optional, List, Union

from .reddit.comment import Comment
from .reddit.more import MoreComments
from .reddit.submission import Submission


class CommentForest(List[Union[Comment, MoreComments]]):
def __getitem__(self, index: int): ...
def __init__(self, submission: Submission, comments: Optional[List[Comment]] = ...) -> CommentForest: ...
def __len__(self) -> int: ...
def list(self) -> List[Comment]: ...
def replace_more(self, limit: int = ..., threshold: int = ...) -> List[MoreComments]: ...
9 changes: 9 additions & 0 deletions stubs/praw/models/front.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import ListingGenerator
from .listing.mixins import SubredditListingMixin as SubredditListingMixin
from .reddit.submission import Submission
from ..reddit import Reddit


class Front(SubredditListingMixin):
def __init__(self, reddit: Reddit) -> None: ...
def best(self, **generator_kwargs: str) -> ListingGenerator[Submission]: ...
22 changes: 22 additions & 0 deletions stubs/praw/models/helpers.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Any, Optional, List, Sequence, Literal

from . import ListingGenerator
from .base import PRAWBase as PRAWBase
from .reddit.live import LiveThread as LiveThread
from .reddit.multi import Multireddit as Multireddit
from .reddit.subreddit import Subreddit


class LiveHelper(PRAWBase):
def __call__(self, id: str) -> LiveThread: ...
def info(self, ids: List[str]) -> ListingGenerator[LiveThread]: ...
def create(self, title: str, description: Optional[str] = ..., nsfw: bool = ..., resources: Optional[str] = ...) -> LiveThread: ...
def now(self) -> Optional[LiveThread]: ...

class MultiredditHelper(PRAWBase):
def __call__(self, redditor: str, name: str) -> Multireddit: ...
def create(self, display_name: str, subreddits: Sequence[Subreddit], description_md: Optional[str] = ..., icon_name: Literal["art and design", "ask", "books", "business", "cars", "comics", "cute animals", "diy", "entertainment", "food and drink", "funny", "games", "grooming", "health", "life advice", "military", "models pinup", "music", "news", "philosophy", "pictures and gifs", "science", "shopping", "sports", "style", "tech", "travel", "unusual stories", "video"] = ..., key_color: Optional[str] = ..., visibility: Literal["hidden", "private", "public"] = ..., weighting_scheme: Literal["classic", "fresh"] = ...) -> Multireddit: ...

class SubredditHelper(PRAWBase):
def __call__(self, display_name: str) -> Subreddit: ...
def create(self, name: str, title: Optional[str] = ..., link_type: Literal["any", "link", "self"] = ..., subreddit_type: Literal["archived", "employees_only", "gold_only", "gold_restricted", "private", "public", "restricted"] = ..., wikimode: Literal["anyone", "disabled", "modonly"] = ..., **other_settings: Any) -> Subreddit: ...
21 changes: 21 additions & 0 deletions stubs/praw/models/inbox.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import List, Generator, NoReturn, Union

from . import Message, ListingGenerator
from .base import PRAWBase as PRAWBase
from .reddit.comment import Comment


class Inbox(PRAWBase):
def all(self, **generator_kwargs: str) -> Generator[Union[Comment, Message]]: ...
def collapse(self, items: List[Message]) -> NoReturn: ...
def comment_replies(self, **generator_kwargs: str) -> ListingGenerator[Comment]: ...
def mark_read(self, items: List[Message]) -> NoReturn: ...
def mark_unread(self, items: List[Message]) -> NoReturn: ...
def mentions(self, **generator_kwargs: str) -> ListingGenerator[Comment]: ...
def message(self, message_id: str) -> Message: ...
def messages(self, **generator_kwargs: str) -> ListingGenerator[Message]: ...
def sent(self, **generator_kwargs: str) -> ListingGenerator[Message]: ...
def stream(self, **stream_options: str) -> ListingGenerator[Message]: ...
def submission_replies(self, **generator_kwargs: str) -> ListingGenerator[Comment]: ...
def uncollapse(self, items: List[Message]) -> NoReturn: ...
def unread(self, mark_read: bool = ..., **generator_kwargs: str) -> Generator[Union[Comment, Message]]: ...
Empty file.
13 changes: 13 additions & 0 deletions stubs/praw/models/list/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from typing import Any, Dict, Optional, List, Iterator, Union

from ..base import PRAWBase as PRAWBase
from ...reddit import Reddit


class BaseList(PRAWBase):
CHILD_ATTRIBUTE: Optional[Union[List[Any], str]] = ...
def __init__(self, reddit: Reddit, _data: Dict[str, Any]) -> BaseList: ...
def __contains__(self, item: Any) -> bool: ...
def __getitem__(self, index: int) -> Any: ...
def __iter__(self) -> Iterator[Any]: ...
def __len__(self) -> int: ...
8 changes: 8 additions & 0 deletions stubs/praw/models/list/redditor.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import List

from .base import BaseList as BaseList
from ..reddit.redditor import Redditor


class RedditorList(BaseList, List[Redditor]):
CHILD_ATTRIBUTE: str = ...
4 changes: 4 additions & 0 deletions stubs/praw/models/list/trophy.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .base import BaseList as BaseList

class TrophyList(BaseList):
CHILD_ATTRIBUTE: str = ...
Empty file.
7 changes: 7 additions & 0 deletions stubs/praw/models/listing/domain.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .mixins import BaseListingMixin as BaseListingMixin, \
RisingListingMixin as RisingListingMixin
from ...reddit import Reddit


class DomainListing(BaseListingMixin, RisingListingMixin):
def __init__(self, reddit: Reddit, domain: str) -> None: ...
17 changes: 17 additions & 0 deletions stubs/praw/models/listing/generator.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import Any, Optional, Dict
from typing import Generator, TypeVar

from ..base import PRAWBase as PRAWBase
from ...reddit import Reddit

T = TypeVar("T")


class ListingGenerator(PRAWBase, Generator[T, None, None]):
limit: int = ...
params: Dict[str, str] = ...
url: str = ...
yielded: int = ...
def __init__(self, reddit: Reddit, url: str, limit: int = ..., params: Optional[Dict[str, str]] = ...) -> ListingGenerator: ...
def __iter__(self) -> ListingGenerator: ...
def __next__(self) -> Any: ...
16 changes: 16 additions & 0 deletions stubs/praw/models/listing/listing.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Any, NoReturn, Optional, TypeVar, Collection

from ..base import PRAWBase as PRAWBase

T = TypeVar("T")

class Listing(PRAWBase, Collection[T]):
CHILD_ATTRIBUTE: str = ...
def __len__(self) -> int: ...
def __getitem__(self, index: int) -> Any: ...
def __setattr__(self, attribute: str, value: Any) -> NoReturn: ...

class FlairListing(Listing):
CHILD_ATTRIBUTE: str = ...
@property
def after(self) -> Optional[Any]: ...
5 changes: 5 additions & 0 deletions stubs/praw/models/listing/mixins/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .base import BaseListingMixin as BaseListingMixin
from .redditor import RedditorListingMixin as RedditorListingMixin
from .rising import RisingListingMixin as RisingListingMixin
from .submission import SubmissionListingMixin as SubmissionListingMixin
from .subreddit import SubredditListingMixin as SubredditListingMixin
12 changes: 12 additions & 0 deletions stubs/praw/models/listing/mixins/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import Any, Set, Literal

from ... import ListingGenerator
from ...base import PRAWBase as PRAWBase


class BaseListingMixin(PRAWBase):
VALID_TIME_FILTERS: Set[str] = ...
def controversial(self, time_filter: Literal["all", "day", "hour", "month", "week", "year"] = ..., **generator_kwargs: str) -> ListingGenerator[Any]: ...
def hot(self, **generator_kwargs: str) -> ListingGenerator[Any]: ...
def new(self, **generator_kwargs: str) -> ListingGenerator[Any]: ...
def top(self, time_filter: Literal["all", "day", "hour", "month", "week", "year"] = ..., **generator_kwargs: str) -> ListingGenerator[Any]: ...
8 changes: 8 additions & 0 deletions stubs/praw/models/listing/mixins/gilded.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import Any

from ... import ListingGenerator
from ...base import PRAWBase as PRAWBase


class GildedListingMixin(PRAWBase):
def gilded(self, **generator_kwargs: str) -> ListingGenerator[Any]: ...
26 changes: 26 additions & 0 deletions stubs/praw/models/listing/mixins/redditor.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from typing import TypeVar, Collection
from typing import Union

from .base import BaseListingMixin as BaseListingMixin
from .gilded import GildedListingMixin as GildedListingMixin
from ...reddit.comment import Comment
from ...reddit.submission import Submission
from ....reddit import Reddit
from ....util.cache import cachedproperty

T = TypeVar("T")


class RedditorListingMixin(BaseListingMixin, GildedListingMixin):
@cachedproperty
def comments(self) -> SubListing[Comment]: ...
@cachedproperty
def submissions(self) -> SubListing[Submission]: ...
def downvoted(self, **generator_kwargs: str) -> Union[Comment, Submission]: ...
def gildings(self, **generator_kwargs: str) -> Union[Comment, Submission]: ...
def hidden(self, **generator_kwargs: str) -> Union[Comment, Submission]: ...
def saved(self, **generator_kwargs: str) -> Union[Comment, Submission]: ...
def upvoted(self, **generator_kwargs: str) -> Union[Comment, Submission]: ...

class SubListing(BaseListingMixin, Collection[T]):
def __init__(self, reddit: Reddit, base_path: str, subpath: str) -> SubListing: ...
8 changes: 8 additions & 0 deletions stubs/praw/models/listing/mixins/rising.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from ... import ListingGenerator
from ...base import PRAWBase as PRAWBase
from ...reddit.submission import Submission


class RisingListingMixin(PRAWBase):
def random_rising(self, **generator_kwargs: str) -> ListingGenerator[Submission]: ...
def rising(self, **generator_kwargs: str) -> ListingGenerator[Submission]: ...
Loading