Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __next__ return #997

Merged
merged 1 commit into from Jun 24, 2020
Merged

Add __next__ return #997

merged 1 commit into from Jun 24, 2020

Conversation

davidhewitt
Copy link
Member

@davidhewitt davidhewitt commented Jun 23, 2020

This builds on #996 by enabling ability to return a value in the StopIteration exception.

If you like this approach I'll write some docs in the guide before we merge this PR.

src/class/iter.rs Outdated Show resolved Hide resolved
@kngwyu
Copy link
Member

kngwyu commented Jun 23, 2020

Thank you! Looks good but I want to make general IterNextOutput<T, U> work.

@davidhewitt davidhewitt force-pushed the pyproto-next-return branch 2 times, most recently from b31894f to a9827a4 Compare June 23, 2020 11:36
@davidhewitt
Copy link
Member Author

Thanks, I like that design. I've pushed that to the branch and added a small sample to the guide.

guide/src/class.md Outdated Show resolved Hide resolved
@davidhewitt davidhewitt force-pushed the pyproto-next-return branch 2 times, most recently from df34963 to c67e94d Compare June 23, 2020 13:54
@davidhewitt
Copy link
Member Author

Good feedback, thanks - I've shortened the doc and moved most of it to PyIterProtocol.

@kngwyu
Copy link
Member

kngwyu commented Jun 23, 2020

Looks rustfmt complains...

@davidhewitt
Copy link
Member Author

🤦 pushed fixed formatting.

@kngwyu
Copy link
Member

kngwyu commented Jun 24, 2020

Thanks!

@kngwyu kngwyu merged commit e35622b into PyO3:master Jun 24, 2020
@davidhewitt davidhewitt deleted the pyproto-next-return branch August 10, 2021 07:19
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.

None yet

2 participants