Skip to content

docs: add Coming-from-Python section + fix stale counts - #1

Merged
conorbronsdon merged 1 commit into
mainfrom
docs/python-onramp-and-accuracy
Jul 7, 2026
Merged

docs: add Coming-from-Python section + fix stale counts#1
conorbronsdon merged 1 commit into
mainfrom
docs/python-onramp-and-accuracy

Conversation

@conorbronsdon

Copy link
Copy Markdown
Owner

Summary

Two documentation changes:

  1. Coming from Python — a short side-by-side section (near the top, after
    the intro) mapping the familiar Python API to this library's real API.
    Every snippet was extracted from this repo's own examples/ and test/;
    nothing was invented.
  2. Accuracy fixes — No accuracy fix needed: suite copy already read "Eleven" and already listed mojo-xml. Test count re-verified by counting: 70 (matches README).

Test counts were re-verified by actually counting the test functions in the
repo (not trusting the prior text).

From an automated review (personal-context#62); drafted by Claude Code — please review the Coming-from-Python snippets for API accuracy.

Adds a "Coming from Python" on-ramp table (verified against the repo's own
examples/ and tests) and corrects suite/test-count accuracy issues.

Co-Authored-By: Claude <noreply@anthropic.com>
@conorbronsdon

Copy link
Copy Markdown
Owner Author

🤖 Independent Claude review: Ready.

Verified: all 6 Mojo snippets in the Coming-from-Python table check out against src/ and examples/:

  • parse_feed(text)src/feed/feed.mojo (def parse_feed(var source: String, ...)), used in examples/list_episodes.mojo
  • fetch_feed(url)src/feed/fetch.mojo (def fetch_feed(url: String))
  • feed.title, feed.itemsFeed struct fields in src/feed/model.mojo
  • item.title, item.pub_dateFeedItem struct fields in src/feed/model.mojo (note: field is pub_date, correctly matched to feedparser's entry.published)

No invented APIs. Python-side feedparser mapping is idiomatic (parse(text|url), d.feed.title, d.entries, entry.title/entry.published).

Count re-verified by counting test fns via API: test_date 11 + test_feed 19 + test_real_feed 10 + test_xml_parser 30 = 70, matching README ('70 tests across four files … XML tokenizer (30)'). 'Eleven pure-Mojo libraries' and the mojo-xml cross-links are present. The diff itself only adds the table (the accuracy items were already correct upstream, as the PR body notes).

@conorbronsdon
conorbronsdon marked this pull request as ready for review July 6, 2026 07:58
@conorbronsdon

Copy link
Copy Markdown
Owner Author

Docs review (sonnet): SHIP-WITH-NITS

The 5-row feedparser→mojo-feed table is accurate (parse_feed, fetch_feed, Feed.title/.items, FeedItem.title/.pub_date all real fields, correctly shown as attribute access). 70-test count exact. Suite count was already correct pre-PR.

Nit: the title/description says "fix stale counts," but nothing was stale — the diff is a pure +12/-0 addition with zero count changes. Title overstates what the PR does; trim before merge (harmless).

@conorbronsdon
conorbronsdon merged commit 3122960 into main Jul 7, 2026
1 check passed
@conorbronsdon
conorbronsdon deleted the docs/python-onramp-and-accuracy branch July 7, 2026 06:24
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.

1 participant