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

introduce PyIterator::from_bound_object #3702

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

davidhewitt
Copy link
Member

Follows the standard pattern we're now going for to introduce a new bound constructor while deprecating the old one.

This isn't mergeable until after #3694

pub(crate) fn from_object2<'py>(obj: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyIterator>> {
/// Constructs a `PyIterator` from a Python iterable object.
///
/// Equivalent to Python's built-in `iter` function.
Copy link
Member

Choose a reason for hiding this comment

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

I think an intra doc link to PyAnyMethods::iter would be nice as this is usually the more convenient form compared to calling this directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed 👍

Copy link

codspeed-hq bot commented Jan 2, 2024

CodSpeed Performance Report

Merging #3702 will improve performances by 11.66%

Comparing davidhewitt:bound-iterator-constructor (783e98b) with main (5ea2e5c)

Summary

⚡ 1 improvements
✅ 77 untouched benchmarks

Benchmarks breakdown

Benchmark main davidhewitt:bound-iterator-constructor Change
extract_int_downcast_fail 266.1 ns 238.3 ns +11.66%

@davidhewitt davidhewitt added this pull request to the merge queue Jan 2, 2024
Merged via the queue into PyO3:main with commit eceb28b Jan 2, 2024
37 checks passed
@davidhewitt davidhewitt deleted the bound-iterator-constructor branch January 2, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants