Skip to content

Commit

Permalink
Merge 9b00b81 into aeccb24
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d3rman committed Oct 6, 2023
2 parents aeccb24 + 9b00b81 commit 8f0652b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Expand Up @@ -84,4 +84,5 @@ Source Contributors
- Josh Kim `@jsk56143 <https://github.com/jsk56143>`_
- Rolf Campbell `@endlisnis <https://github.com/endlisnis>`_
- zacc `@zacc <https://github.com/zacc>`_
- c0d3rman `@c0d3rman <https://github.com/c0d3rman>`
- Add "Name <email (optional)> and github profile link" above this line.
7 changes: 5 additions & 2 deletions praw/models/util.py
Expand Up @@ -35,7 +35,7 @@ def permissions_string(


@_deprecate_args(
"function", "pause_after", "skip_existing", "attribute_name", "exclude_before"
"function", "pause_after", "skip_existing", "attribute_name", "exclude_before", "start_after"
)
def stream_generator(
function: Callable,
Expand All @@ -44,6 +44,7 @@ def stream_generator(
exclude_before: bool = False,
pause_after: int | None = None,
skip_existing: bool = False,
start_after: str | None = None,
**function_kwargs: Any,
) -> Generator[Any, None, None]:
"""Yield new items from ``function`` as they become available.
Expand All @@ -62,6 +63,8 @@ def stream_generator(
:param skip_existing: When ``True``, this does not yield any results from the first
request thereby skipping any items that existed in the stream prior to starting
the stream (default: ``False``).
:param start_after: The initial string value to use for ``before`` in ``params``.
The stream will start from the item following this one (default: ``None``).
Additional keyword arguments will be passed to ``function``.
Expand Down Expand Up @@ -122,7 +125,7 @@ def stream_generator(
print(comment)
"""
before_attribute = None
before_attribute = start_after
exponential_counter = ExponentialCounter(max_counter=16)
seen_attributes = BoundedSet(301)
without_before_counter = 0
Expand Down

0 comments on commit 8f0652b

Please sign in to comment.