Skip to content

add PyObject_HasAttrWithError & use it in PyAnyMethods::hasattr#5944

Merged
davidhewitt merged 7 commits intoPyO3:mainfrom
bschoenmaeckers:hasattr
May 2, 2026
Merged

add PyObject_HasAttrWithError & use it in PyAnyMethods::hasattr#5944
davidhewitt merged 7 commits intoPyO3:mainfrom
bschoenmaeckers:hasattr

Conversation

@bschoenmaeckers
Copy link
Copy Markdown
Member

closes #5940

@bschoenmaeckers bschoenmaeckers force-pushed the hasattr branch 3 times, most recently from b7788e9 to 03bea8a Compare April 3, 2026 15:04
@bschoenmaeckers bschoenmaeckers force-pushed the hasattr branch 2 times, most recently from 0e7f4b4 to 90c7d67 Compare April 3, 2026 15:32
Copy link
Copy Markdown
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks, a few suggestions to this one.

Comment thread src/types/any.rs Outdated
Comment thread src/types/any.rs Outdated
Comment thread src/types/any.rs
@davidhewitt davidhewitt mentioned this pull request Apr 30, 2026
@bschoenmaeckers
Copy link
Copy Markdown
Member Author

Sorry I let this stall. I will revisit this tomorrow to get it ready for the next release.

@bschoenmaeckers
Copy link
Copy Markdown
Member Author

This is ready for another review.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 1, 2026

Merging this PR will improve performance by 15.48%

⚡ 1 improved benchmark
✅ 104 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Benchmark BASE HEAD Efficiency
bench_pyclass_create 4.6 µs 4 µs +15.48%

Comparing bschoenmaeckers:hasattr (93314b5) with main (8a00673)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

Copy link
Copy Markdown
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks 💯

@davidhewitt davidhewitt added this pull request to the merge queue May 2, 2026
Merged via the queue into PyO3:main with commit 20e0cdc May 2, 2026
46 checks passed
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.

Use PyObject_HasAttrWithError on Python 3.13+

2 participants