Skip to content

gh-119786: added InternalDocs/generators.md - #128524

Merged
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:generators_doc
Jan 16, 2025
Merged

gh-119786: added InternalDocs/generators.md#128524
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:generators_doc

Conversation

@iritkatriel

@iritkatrieliritkatriel commented Jan 5, 2025

Copy link
Copy Markdown
Member

Comment threadInternalDocs/generators.md Outdated
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>

@markshannonmarkshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to cover the semantics, which I think we can assume the reader knows, more than the implementation.

Some things I think are worth covering:

  • The location of the frame, specifically how it moves from generator to frame object if the frame object outlives the generator
  • Similarities and differences between yield and return (you already cover this)
  • Generator construction (RETURN_GENERATOR)
  • Specialization of FOR_ITER for generators
  • How yield from is implemented
  • Why CLEANUP_THROW needs to exist.

Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated

@markshannonmarkshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A useful addition to the docs.

I have a few more suggestions, but this mostly looks good.

Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md Outdated
Comment threadInternalDocs/generators.md
@iritkatriel
iritkatriel enabled auto-merge (squash) January 16, 2025 13:15
@iritkatriel
iritkatriel merged commit e81fe94 into python:mainJan 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

@iritkatriel@tomasr8@markshannon