Skip to content

docs(convert): note how __main__ guards are rewritten#10286

Closed
Bartok9 wants to merge 1 commit into
marimo-team:mainfrom
Bartok9:top10/docs-convert-main-guard-behavior
Closed

docs(convert): note how __main__ guards are rewritten#10286
Bartok9 wants to merge 1 commit into
marimo-team:mainfrom
Bartok9:top10/docs-convert-main-guard-behavior

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

This pull request was authored by a coding agent.

AI-assisted; human-reviewed.

Summary

When converting plain Python scripts, marimo rewrites a top-level
if __name__ == \"__main__\": into a _main_() helper. This adds a short note
in the Jupyter migration guide so that behavior (and the string/comment
non-match rule) is not a surprise after marimo convert.

Docs only. Complements salvage #10284.

Checklist

  • I have read the CLA Document and I hereby sign the CLA
  • AI code reviewed by the human author

Document that plain-script conversion rewrites top-level main-guards into
helpers, and that string/comment occurrences are ignored. Complements the
AST-based convert fix.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 22, 2026 10:56pm

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 22, 2026
@Bartok9

Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@dmadisetti

Copy link
Copy Markdown
Member

This may change with #10237

@Bartok9

Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown
Author

Good call, @dmadisetti — this doc note is tied to the rewrite behavior in #10237, so I'll close this too and let @vidigoat's PR land first. Happy to revisit the docs once the final behavior is settled. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants