Repository navigation
Conversation
The generated API pages now list arguments, return values, and raised exceptions for the public emitters. The sections follow the code paths, and the existing prose is unchanged. Closes jfhbrook#221 Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
|
Looks legit. I'm a little picky about prose, so I'll have to read through and make some copy edits. But this is an excellent start! I'll pull it in when I do the next release. Thanks! |
Contributor
Author
Owner
|
Merged manually. Cheers! |
Owner
|
Releasing in v16.0.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #221.
🤖 AI tooling was used for this PR. The sections were drafted with an AI coding assistant. I checked each entry against the code path it describes and ran the checks below. The commit subject and the changelog bullet carry the 🤖 marker per DEVELOPMENT.md.
What Is This?
Google-style
Args:,Returns:andRaises:sections on the public API thatdocs/api.mdrenders. mkdocstrings-python parses Google style by default, so the API page now shows parameter, return and exception tables. The existing prose, examples and code fences are unchanged. Only sections were appended, and four one-line docstrings became multi-line to hold them.Covered:
EventEmitter(on,listens_to,add_listener,event_names,emit,once,remove_listener,remove_all_listeners,listeners),AsyncIOEventEmitter(constructor,emit,complete),ExecutorEventEmitter(constructor,shutdown),TrioEventEmitter(constructor,context),uplift,unwrap,pyee.cls.onandevented.Why Is This?
The issue asks for it, and the API page had none of these sections. A few behaviors were only visible in the code before:
emitreturns whether any handler was attached. On"error"with no listener it raises the first argument if it is anException, andPyeeErrorotherwise.onandoncereturn the handler whenfis given, and a decorator when it is not.remove_listenerdoes nothing for a listener that is not registered.TrioEventEmitterraisesPyeeErrorwhen bothnurseryandmanagerare passed, andcontextraises it when neither is set.upliftraisesKeyErrorfor an unknownerror_handlingorproxy_new_listenervalue. That comes from a dict lookup, not an explicitraise.Anything We Need To Know?
pyee.cls.HandlerandHandlers, the bookkeeping behind@on.TwistedEventEmitter,wait_for_completeandcanceltake no arguments and return nothing, so they get no sections.*argsand**kwargsonemitandupliftare listed asargsandkwargs, the names griffe uses.Conventionssection of the AGENTS.md in 🤖 Add AGENTS.md for AI coding agents #220 says the docstrings have noArgs,ReturnsorRaisessections. Whichever of the two lands second, I'll update that line.Verification
On this branch (Python 3.13, uv):
just format: no changes.just lint: flake8 clean,Valid file: ./pyproject.toml.just check:0 errors, 0 warnings, 0 informations.just mypy:Success: no issues found in 16 source files.just test:52 passed.uv run mkdocs build --strict: builds clean. In the builtapi/index.html, the counts ofParameters:/Returns:/Raises:go from 0 / 0 / 0 onmainto 17 / 35 / 13.main, 3 on this branch (theHandler/Handlersitems above).Questions
DEVELOPMENT.md?CHANGELOG.md?CONTRIBUTORS.mdfile?