Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-76991: Allow accessing the ags_gen and agt_gen attrs of async generators#11166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@ZackerySpytz
Copy link
Contributor

@ZackerySpytzZackerySpytz commentedDec 14, 2018
edited by bedevere-appbot
Loading

Copy link
Contributor

@asvetlovasvetlov left a comment

Choose a reason for hiding this comment

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

Looks very good, thanks!

Would you add a docs update to reflect new fields?

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@1st1
Copy link
Member

Please don't merge this. I'm not sure i want them to be exposed.

Copy link
Member

@1st11st1 left a comment
edited
Loading

Choose a reason for hiding this comment

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

We need to consider this carefully. Exposing these fields pins the current implementation and might prevent us from evolving it. It's also unclear if it's possible to implement this in PyPy et al

@asvetlov
Copy link
Contributor

@1st1 thank you for sharing your worries.
I'll assign you to the PR.
You will decide, ok?

1st1 reacted with thumbs up emoji

@asvetlovasvetlov assignedasvetlov and1st1 and unassignedasvetlovDec 15, 2018
@csabella
Copy link
Contributor

@1st1, just wondering if there is any update for this idea? Should the PR be closed so that the discussion can happen on the bug tracker first? Thanks!

@vxgmichel
Copy link
Contributor

We need to consider this carefully. Exposing these fields pins the current implementation and might prevent us from evolving it. It's also unclear if it's possible to implement this in PyPy et al

Another way of fixing the issue described inbpo-32810 without adding extra field names is to exposeasync_generator.ag_* asasync_generator_asend.cr_* (andasync_generator_athrow.cr_*), i.e:

  • async_generator_asend.cr_await ->async_generator_asend.ags_gen.ag_await
  • async_generator_asend.cr_code ->async_generator_asend.ags_gen.ag_code
  • async_generator_asend.cr_frame ->async_generator_asend.ags_gen.ag_frame
  • async_generator_asend.cr_running ->async_generator_asend.ags_gen.ag_running
  • async_generator_athrow.cr_await ->async_generator_athrow.agt_gen.ag_await
  • async_generator_athrow.cr_code ->async_generator_athrow.agt_gen.ag_code
  • async_generator_athrow.cr_frame ->async_generator_athrow.agt_gen.ag_frame
  • async_generator_athrow.cr_running ->async_generator_athrow.agt_gen.ag_running

Retrieving the stack can then be implemented by simply walking up the chain of coroutines usingcr_await andcr_frame. This would work transparently whether the stack contains async generators or not.

@iritkatriel
Copy link
Member

https://bugs.python.org/issue32810 is closed. What is the status of this PR?

@erlend-aaslanderlend-aasland changed the titlebpo-32810: Allow accessing the ags_gen and agt_gen attrs of async generatorsgh-76991: Allow accessing the ags_gen and agt_gen attrs of async generatorsJan 5, 2024
@erlend-aasland

This comment was marked as outdated.

@erlend-aasland
Copy link
Contributor

I fixed the merge conflicts, but the tests are failing all over the place. It looks to me the assumptions in the test in6024d01 from 2018 won't hold in 2023.

@gvanrossum
Copy link
Member

I am just closing this. In 2018@1st1 didn't like the idea of exposing these fields. Here we are 6 years later and the only reason we're back looking at this is that someone decided to audit the OP's PRs.

erlend-aasland reacted with thumbs up emojierlend-aasland reacted with hooray emoji

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

Reviewers

@1st11st11st1 requested changes

@asvetlovasvetlovasvetlov requested changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees

@1st11st1

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

11 participants

@ZackerySpytz@bedevere-bot@1st1@asvetlov@csabella@vxgmichel@iritkatriel@erlend-aasland@gvanrossum@the-knights-who-say-ni@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp