Skip to content

PYTHON-5900 - Clarify Cursor and CommandCursor docstrings to indicate… - #2900

Merged
NoahStapp merged 2 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5900
Jun 30, 2026
Merged

NoahStapp merged 2 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5900

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

… where they are used

PYTHON-5900

Changes in this PR

See ticket.

Test Plan

N/A.

Checklist

Checklist for Author

  • [ ] Did you update the changelog (if necessary)?
  • [ ] Is there test coverage?
  • [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Clarifies Cursor and CommandCursor/AsyncCommandCursor docstrings to explicitly state which public APIs construct and use these cursors, improving discoverability in the public-facing documentation.

Changes:

  • Update Cursor.__init__ docstrings (sync/async) to mention Collection.find / AsyncCollection.find as the primary entry points.
  • Expand CommandCursor and AsyncCommandCursor class docstrings to list the calling APIs that return these cursors.
  • Adjust the async command cursor module docstring to reflect AsyncCommandCursor.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pymongo/synchronous/cursor.py Clarifies that Collection.find creates/uses Cursor for query results.
pymongo/synchronous/command_cursor.py Expands CommandCursor docstring with the public APIs that return it (needs minor reST fixes).
pymongo/asynchronous/cursor.py Clarifies that AsyncCollection.find creates/uses AsyncCursor for query results.
pymongo/asynchronous/command_cursor.py Renames module docstring and expands AsyncCommandCursor docstring with calling APIs (needs minor reST fixes).

Comment thread pymongo/synchronous/command_cursor.py Resolved
Comment thread pymongo/asynchronous/command_cursor.py Resolved
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@aclark4life aclark4life left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NoahStapp
NoahStapp merged commit bb7a81f into mongodb:master Jun 30, 2026
88 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.

4 participants