Title: Passing own function to library function breaks visualization · Issue #161 · skogsbaer/write-your-python-program · GitHub
Open Graph Title: Passing own function to library function breaks visualization · Issue #161 · skogsbaer/write-your-python-program
X Title: Passing own function to library function breaks visualization · Issue #161 · skogsbaer/write-your-python-program
Description: To reproduce this problem set up a directory structure like this: . ├── app │ └── example.py ├── libs │ └── factorial │ ├── __init__.py ... example.py: import factorial def mul(a, b): return a * b result = factorial.factorial(3, mul) pri...
Open Graph Description: To reproduce this problem set up a directory structure like this: . ├── app │ └── example.py ├── libs │ └── factorial │ ├── __init__.py ... example.py: import factorial def mul(a, b): return a * b ...
X Description: To reproduce this problem set up a directory structure like this: . ├── app │ └── example.py ├── libs │ └── factorial │ ├── __init__.py ... example.py: import factorial def mul(a, b): return a * b ...
Opengraph URL: https://github.com/skogsbaer/write-your-python-program/issues/161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Passing own function to library function breaks visualization","articleBody":"To reproduce this problem set up a directory structure like this:\r\n```\r\n.\r\n├── app\r\n│ └── example.py\r\n├── libs\r\n│ └── factorial\r\n│ ├── __init__.py\r\n...\r\n```\r\n\r\nexample.py:\r\n```python\r\nimport factorial\r\n\r\ndef mul(a, b):\r\n return a * b\r\n\r\nresult = factorial.factorial(3, mul)\r\nprint(result)\r\n```\r\n\r\n__init__.py:\r\n```python\r\ndef factorial(n, op):\r\n if n \u003c= 1:\r\n return 1\r\n prev = factorial(n - 1, op)\r\n a = op(n, prev)\r\n return a\r\n```\r\n\r\nRun the trace generator with something like `PYTHONPATH=libs python3 main.py app/example.py` and you should get an error.\r\n\r\nThe question remaining is: how should this situation be visualized? \r\nOption 1: We can skip everything that is executed through the library. In the example, executing `factorial.factorial` would just be one step. \r\nOption 2: We can somehow visualize the steps again once we reach code that is non-library code. In this latter case, do we omit the stack frames generated by the library and have the visualization \"randomly\" jump to some non-library code again? \r\nOption 3: (Is there another one?)\r\n\r\nOption 2 would probably require more effort to realize as we always need to keep track of all the steps that are happening inside of a library to get a correct visualization (even if we don't visualize them). This would very likely also decrease the performance quite a bit.","author":{"url":"https://github.com/hannesbraun","@type":"Person","name":"hannesbraun"},"datePublished":"2024-11-26T14:14:38Z","url":"https://github.com/skogsbaer/write-your-python-program/issues/161"}
| 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:17c13c50-0372-3afa-947a-6b597630a797 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D562:3FF2FE:944E38:CC548A:6B00A51A |
| html-safe-nonce | d4d5739c3610a905ae8d1d4edd9b5facdbfe925273eec9aafc94748a4b0a0d3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTYyOjNGRjJGRTo5NDRFMzg6Q0M1NDhBOjZCMDBBNTFBIiwidmlzaXRvcl9pZCI6IjQxNzU3OTE2MzE4OTI1MjIyNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74134cf702cf0169012f1d9811fabe5b96a3a6157c2f0a7a3527bea9a6033f13 |
| hovercard-subject-tag | issue:2694819816 |
| 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/skogsbaer/write-your-python-program/161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b2099cd34c16995e06615133ebe749aead5fb92514676d348e4e2b0a41af5bf/skogsbaer/write-your-python-program/issues/161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b2099cd34c16995e06615133ebe749aead5fb92514676d348e4e2b0a41af5bf/skogsbaer/write-your-python-program/issues/161 |
| og:image:alt | To reproduce this problem set up a directory structure like this: . ├── app │ └── example.py ├── libs │ └── factorial │ ├── __init__.py ... example.py: import factorial def mul(a, b): return a * b ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hannesbraun |
| hostname | github.com |
| expected-hostname | github.com |
| None | 455b493e3402a3a3a06beac5d20bb7db3da060808b220aa48d6a7eca7c59863a |
| turbo-cache-control | no-preview |
| go-import | github.com/skogsbaer/write-your-python-program git https://github.com/skogsbaer/write-your-python-program.git |
| octolytics-dimension-user_id | 567524 |
| octolytics-dimension-user_login | skogsbaer |
| octolytics-dimension-repository_id | 295649345 |
| octolytics-dimension-repository_nwo | skogsbaer/write-your-python-program |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 295649345 |
| octolytics-dimension-repository_network_root_nwo | skogsbaer/write-your-python-program |
| 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 | 2f575159976167242d488c0b062eb355c4e198b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width