Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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.

@davidhewitt davidhewitt force-pushed the pyproto-next-return branch from d8cb1e6 to e90a270 Compare June 23, 2020 10:50
@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.

@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.

@davidhewitt davidhewitt force-pushed the pyproto-next-return branch from c67e94d to e1105f4 Compare June 23, 2020 13:56
@kngwyu
Copy link
Member

kngwyu commented Jun 23, 2020

Looks rustfmt complains...

@davidhewitt davidhewitt force-pushed the pyproto-next-return branch from e1105f4 to 9f9137c Compare June 23, 2020 16:13
@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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants