Title: stack_data, executing, and pure_eval · Issue #748 · getsentry/sentry-python · GitHub
Open Graph Title: stack_data, executing, and pure_eval · Issue #748 · getsentry/sentry-python
X Title: stack_data, executing, and pure_eval · Issue #748 · getsentry/sentry-python
Description: Hi! I've recently created a few libraries that are helpful for extracting information from frames and tracebacks, and I think they could be very useful to sentry. executing can identify the exact AST node being executed by a frame in man...
Open Graph Description: Hi! I've recently created a few libraries that are helpful for extracting information from frames and tracebacks, and I think they could be very useful to sentry. executing can identify the exact A...
X Description: Hi! I've recently created a few libraries that are helpful for extracting information from frames and tracebacks, and I think they could be very useful to sentry. executing can identify the exa...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/748
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stack_data, executing, and pure_eval","articleBody":"Hi! I've recently created a few libraries that are helpful for extracting information from frames and tracebacks, and I think they could be very useful to sentry.\r\n\r\n- [`executing`](https://github.com/alexmojaki/executing) can identify the exact AST node being executed by a frame in many cases. It's always disappointed me that Python only points to a line in each frame in tracebacks, especially when the expression/statement at fault spans many lines. Sometimes it can be really hard to interpret. Currently [executing is used in IPython](https://github.com/ipython/ipython/pull/12150) (in master, unreleased) to highlight the node, here's what it looks like:\r\n\r\n\r\n\r\n- `executing` can also infer a function `__qualname__` from a code object, meaning your traceback can say `lorem/ipsum.py in MyClass.__init__ at line 123` instead of just `__init__`, which is much more informative.\r\n- [`pure_eval`](https://github.com/alexmojaki/pure_eval) can safely evaluate certain AST nodes without side effects, so that if the source for a frame contains expressions like `self.foo` and `bar[key]` their values can often be shown alongside plain variables.\r\n- [`stack_data`](https://github.com/alexmojaki/stack_data) collects data from tracebacks for the purpose of formatting and displaying them. It uses `executing` and `pure_eval` and also provides a lot of functionality of its own. For example, in this frame:\r\n\r\n\r\n\r\nthere are lines from `complex_filter` which the user doesn't need to see, and `stack_data` knows how to filter those out by only collecting lines which belong in the current scope. [I integrated`stack_data` into IPython](https://github.com/ipython/ipython/pull/11886) which allowed removing a lot of flaky custom introspection code, fixing several bugs and making the code more maintainable.\r\n- `stack_data` identifies the locations of variables and evaluated expressions in the source lines. An intelligent UI could use this, for example, to allow the user to hover over a variable in source code to see its value rather than scroll through a list to find it.\r\n\r\nOverall there are lots of possibilities. What would interest you? I'm willing to make a PR and make any necessary changes to the libraries.","author":{"url":"https://github.com/alexmojaki","@type":"Person","name":"alexmojaki"},"datePublished":"2020-06-27T18:14:53Z","url":"https://github.com/getsentry/sentry-python/issues/748"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6cf5b4b0-bfe2-2ca1-5503-85ee81d0bfdc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C624:12285C:555353:728304:6B00912B |
| html-safe-nonce | ee6aeff61fc7f24a97d4824f529a34fa44b029b46522f4243f851ee0ffa2830f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjI0OjEyMjg1Qzo1NTUzNTM6NzI4MzA0OjZCMDA5MTJCIiwidmlzaXRvcl9pZCI6IjIxNTgxMTc5MTE1MTA2ODM5NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 72078b2d255161542a1f803d73ba8590182a15d4540b07e528ad9caaf1af007a |
| hovercard-subject-tag | issue:646729023 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/748/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2dfd6feb61f103f50247b72c91ccc86024f01989e780be93f6346c8b73f1984c/getsentry/sentry-python/issues/748 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2dfd6feb61f103f50247b72c91ccc86024f01989e780be93f6346c8b73f1984c/getsentry/sentry-python/issues/748 |
| og:image:alt | Hi! I've recently created a few libraries that are helpful for extracting information from frames and tracebacks, and I think they could be very useful to sentry. executing can identify the exact A... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexmojaki |
| hostname | github.com |
| expected-hostname | github.com |
| None | c710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | be616a2a6ec1c609d6e002896dff5352d5c5f28b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width