Skip to content

Put the async twin note above the constructor in the generated reference - #101

Merged
arrufat merged 1 commit into
mainfrom
generator-twin-note-placement
Sep 15, 2026
Merged

arrufat merged 1 commit into
mainfrom
generator-twin-note-placement

Conversation

@arrufat

@arrufat arrufat commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Addresses the second round of review feedback on #97.

For an Async* class, the fact that every method of its sync twin exists on it is the first thing a reader needs. emit_class printed that sentence last, below the constructor signature, its argument list and the context-manager note, so it arrived after the details it was meant to frame. This moves it to just after the class description.

The reviewer asked for this on AsyncCDPServer and AsyncBiDiServer. Fixing it in the generator also covers AsyncBrowser and AsyncSession, which had the same problem and were not commented on.

One note on placement. The suggestion pointed at the line between a class's intro prose and its usage example, but that example lives inside the class docstring, so the generator emits prose and example as one unit. The sentence now lands after the whole docstring. Splitting them would mean parsing docstring internals, which does not seem worth it.

The text itself is unchanged; this is purely a move.

Pairs with lightpanda-io/lightpanda-python#8, which handles the repeated "Forwarded to the sync class" bullets from the first round. The two are independent and can land in either order. I generated the page against the current SDK main as well as against that branch, and both come out valid.

Editing this script is a trigger path for the python-reference workflow, so the generation runs here as a smoke check.

For an Async* class, the fact that it mirrors its sync twin is the first
thing a reader needs, but emit_class printed it last, below the constructor
signature and argument list. Move it to just after the class description.

Review feedback on the generated page asked for this on the two async
servers; doing it in the generator also covers AsyncBrowser and AsyncSession.
@arrufat
arrufat merged commit ac0511b into main Sep 15, 2026
2 checks passed
@arrufat
arrufat deleted the generator-twin-note-placement branch September 15, 2026 18:16
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