Skip to content

add #[track_caller] to all Py/Bound/Borrowed methods which panic#4098

Merged
adamreichold merged 1 commit intoPyO3:mainfrom
davidhewitt:track-caller
Apr 19, 2024
Merged

add #[track_caller] to all Py/Bound/Borrowed methods which panic#4098
adamreichold merged 1 commit intoPyO3:mainfrom
davidhewitt:track-caller

Conversation

@davidhewitt
Copy link
Copy Markdown
Member

While debugging pydantic/pydantic#9250 this morning, I realised it would be much more helpful if the panic message originated from the actual source location that attempted to construct the failed pointer, rather than deep in the guts of PyO3.

With this enabled, that reproduction actually panics with:

thread '<unnamed>' panicked at /home/david/dev/pydantic/pyo3/src/types/any.rs:2226:18:

which is in PyAnyMethods::dir - it turns out that __dir__ can indeed be fallible, so I'll open a separate issue for that now...

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 19, 2024

CodSpeed Performance Report

Merging #4098 will not alter performance

Comparing davidhewitt:track-caller (8bdbb00) with main (d42c00d)

🎉 Hooray! pytest-codspeed just leveled up to 2.2.1!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 69 untouched benchmarks

@adamreichold adamreichold added this pull request to the merge queue Apr 19, 2024
Merged via the queue into PyO3:main with commit cd28e14 Apr 19, 2024
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.

2 participants