Skip to content

Commit

Permalink
Merge pull request psf#485 from python-pitfalls/master
Browse files Browse the repository at this point in the history
removed a case of the default mutable argument pitfall
  • Loading branch information
surister authored Feb 26, 2023
2 parents 9542dc0 + 3c0a50f commit 87a047d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,14 @@ def __init__(self, *, session: Union['HTMLSession', 'AsyncHTMLSession'] = None,
def __repr__(self) -> str:
return f"<HTML url={self.url!r}>"

def next(self, fetch: bool = False, next_symbol: _NextSymbol = DEFAULT_NEXT_SYMBOL) -> _Next:
def next(self, fetch: bool = False, next_symbol: _NextSymbol = None) -> _Next:
"""Attempts to find the next page, if there is one. If ``fetch``
is ``True`` (default), returns :class:`HTML <HTML>` object of
next page. If ``fetch`` is ``False``, simply returns the next URL.
"""
if next_symbol is None:
next_symbol = DEFAULT_NEXT_SYMBOL

def get_next():
candidates = self.find('a', containing=next_symbol)
Expand Down

0 comments on commit 87a047d

Please sign in to comment.