The current documentation for pywikibot.Site.logevents() is ambiguous about how the start, end, and reverse parameters work.
According to the [[ https://www.mediawiki.org/wiki/API:Logevents | MediaWiki API:Logevents ]] documentation:
- **start :** “The timestamp to start enumerating from.”
- **end :** “The timestamp to stop enumerating at.”
- **reverse :** “List oldest first. Note that the meaning of the 'start' and 'end' parameters is reversed when this is enabled.”
However, [[ https://doc.wikimedia.org/pywikibot/stable/_modules/pywikibot/page/_user.html#User.logevents | Pywikibot’s current docstring ]] implies that start and end act like “after” and “before,” which can lead to confusion when users iterate through logs or check block events.
**Solution**
This task proposes updating the docstring to match the MediaWiki API wording exactly.
Proposed docstring update:
```
start : Timestamp, optional
The timestamp to start enumerating from.
end : Timestamp, optional
The timestamp to end enumerating at.
reverse : bool, optional
If True, list oldest first and reverse the meaning of 'start' and 'end'.
```
** Example code for testing **
```
import pywikibot
from datetime import datetime
site = pywikibot.Site('en', 'wikipedia')
start = datetime(2025, 9, 10, 12, 0, 0 )
end = datetime(2025, 9, 12, 12, 0, 0 )
reverse = True
for entry in site.logevents(start=start, end=end, total=50, reverse=reverse):
print(f"{entry.timestamp()}: {entry.type()} - {entry.action()}")
```
**Documentation**
* [[ https://www.mediawiki.org/wiki/Manual:Pywikibot/Gerrit#For_developers | Manual:Pywikibot/Gerrit - For_developers]]
* [[ https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines | Gerrit : Commit message guidelines ]]
* T407059 Pywikibot contribution howto ( our documentation notes ticket )