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 6, 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 — Suite copy Ten -> Eleven and added mojo-xml link. Test count re-verified by counting: 38 (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 7 Mojo API references in the new "Coming from Python" section against real source — every one exists, no invented APIs:

  • urlparse, parse_qsl, quote, unquote, urljoin, urlencode, QueryPair — all exported in src/url/__init__.mojo
  • r.scheme / r.netloc / r.path / r.query — real ParseResult attributes (used in examples/parse_and_build.mojo)
  • urlencode(pairs) signature confirmed List[QueryPair] (src/url/parse.mojo:468); QueryPair(key, value) takes two Strings — the "not a dict" note is accurate vs Python.
  • Python-side snippets (urlparse, parse_qsl, quote/unquote, urljoin, dict-based urlencode) are idiomatic urllib.parse.

Accuracy fixes check out:

  • "38 tests" matches exactly 38 test_* fns in test/test_url.mojo.
  • "Eleven pure-Mojo libraries": 10 sibling bullets + mojo-url itself = 11 (consistent with the Ten→Eleven bump + one added bullet). New mojo-xml cross-link resolves.

Minor (non-blocking): the "Eleven" count relies on the reader treating mojo-url as the 11th member of its own suite — correct but implicit; a parenthetical like "(including this one)" would remove ambiguity.

@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

"38 tests total" verified (38 in test/test_url.mojo). Table checked against src/url/parse.mojo + model.mojourlparse -> ParseResult, parse_qsl, quote/unquote, urljoin, and the urlencode(List[QueryPair]) (not dict) callout all correct. Suite count consistent. No issues.

@conorbronsdon
conorbronsdon merged commit c416ebf into main Jul 6, 2026
1 check passed
@conorbronsdon
conorbronsdon deleted the docs/python-onramp-and-accuracy branch July 6, 2026 08:13
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