Skip to content

Fix docstring Args entries that name a parameter the function does not take - #8995

Merged
The-Compiler merged 2 commits into
qutebrowser:mainfrom
darkdi:fix/docstring-arg-names
Aug 8, 2026
Merged

Fix docstring Args entries that name a parameter the function does not take#8995
The-Compiler merged 2 commits into
qutebrowser:mainfrom
darkdi:fix/docstring-arg-names

Conversation

@darkdi

@darkdi darkdi commented Aug 6, 2026

Copy link
Copy Markdown

Fourteen Args: entries name a parameter the function does not take. Docstrings only.

Seven renames:

Where Documented Actual
EventFilter._handle_mouse_release e _e
Completer._change_completed_part text newtext
CompletionModel._cat_from_idx idx index
HostBlocker._read_hosts_line line raw_line
BaseKeyParser._debug_log message msg
_is_url_dns url urlstr
DownloadModel._on_data_changed start + end idx

The last one had two entries where the signature has one: start/end are from a version that took a range.

The rest document an argument that is gone: count in _tab_close (the helper does not take it — the tab-close command does), aliases in _get_alias, idx in _update_window_title, and pages, cmdhist and exc in _gather_crash_info, which takes only self.

I left two groups alone, since both look like house convention rather than mistakes:

  • Class docstrings that list attributes under Args:GUIProcess, SocketError, ListenError, LineParser, NeighborList. Their __init__ arguments are documented separately in the constructor.
  • The count entries on the @cmdutils.register commands in misccommands.py. count is the argument the command takes; cmdutils.Value.count_tab turns it into tab before the Python function sees it, and the command help is built from that docstring.

Everything here was opened and read against the code first.

@darkdi
darkdi requested a review from rcorre as a code owner August 6, 2026 12:45
@darkdi

darkdi commented Aug 6, 2026

Copy link
Copy Markdown
Author

Sorry — the flake8 failure was mine. Removing all three entries from _gather_crash_info left an empty Args: header behind; the docstring is now a single line. Pushed.

@The-Compiler

Copy link
Copy Markdown
Member

Thanks! CI issues are unrelated.

@The-Compiler
The-Compiler merged commit e688202 into qutebrowser:main Aug 8, 2026
32 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants