Title: embed() does not honor locals when a script is used · Issue #841 · bpython/bpython · GitHub
Open Graph Title: embed() does not honor locals when a script is used · Issue #841 · bpython/bpython
X Title: embed() does not honor locals when a script is used · Issue #841 · bpython/bpython
Description: Hi, I'm using bpython to embed a python intepreter into my application. When a script is used, locals through embed() are lost: from bpython import embed def hello_world(): return 'hello!' embed({'hello': hello_world}, args=['bpython_iss...
Open Graph Description: Hi, I'm using bpython to embed a python intepreter into my application. When a script is used, locals through embed() are lost: from bpython import embed def hello_world(): return 'hello!' embed({'...
X Description: Hi, I'm using bpython to embed a python intepreter into my application. When a script is used, locals through embed() are lost: from bpython import embed def hello_world(): return 'hello!...
Opengraph URL: https://github.com/bpython/bpython/issues/841
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"embed() does not honor locals when a script is used","articleBody":"Hi,\r\n\r\nI'm using bpython to embed a python intepreter into my application. When a script is used, locals through embed() are lost:\r\n\r\n```\r\nfrom bpython import embed\r\n\r\ndef hello_world():\r\n return 'hello!'\r\n\r\nembed({'hello': hello_world}, args=['bpython_issue_script.py'])\r\n\r\n``` \r\n\r\nThe script (_bpython_issue_script.py_) just contains a test: `print('hello' in locals())`\r\n\r\nIt should print `True` but prints `False` due to:\r\n https://github.com/bpython/bpython/blob/077a83784b0b45f40a0abfeefbd9bb54b7ae0db2/bpython/args.py#L146\r\n\r\nCommenting that line solves this issue for me, but I'm not sure if that is the correct fix.\r\n\r\nThanks!","author":{"url":"https://github.com/ocurero","@type":"Person","name":"ocurero"},"datePublished":"2020-08-08T17:28:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/841/bpython/issues/841"}
| 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:6ff68ccf-6ad9-30f1-a378-9fad985a36ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B340:2B2A2E:21FBA2:2FC556:6968C334 |
| html-safe-nonce | 2bcd89e0f91aa2e7db9c56cc52286a0b00d80cf41105569c5d3826b7415e350e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzQwOjJCMkEyRToyMUZCQTI6MkZDNTU2OjY5NjhDMzM0IiwidmlzaXRvcl9pZCI6Ijg4MTc3MzIzMzA2NzA0OTc4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 10c5e7fd75b428192a0962d28e9b03a5976084c155fb401e1235fff39afad34e |
| hovercard-subject-tag | issue:675559698 |
| 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/bpython/bpython/841/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0eede5854172b5b18be1903b4b1a92f95d723d9dcbddf1aed97b4c7eb0186e40/bpython/bpython/issues/841 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0eede5854172b5b18be1903b4b1a92f95d723d9dcbddf1aed97b4c7eb0186e40/bpython/bpython/issues/841 |
| og:image:alt | Hi, I'm using bpython to embed a python intepreter into my application. When a script is used, locals through embed() are lost: from bpython import embed def hello_world(): return 'hello!' embed({'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ocurero |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2ad1b0ea56d6705db45f5db2c83c79d467c52ec2bb1a9b2ec250b964fcb7fb71 |
| turbo-cache-control | no-preview |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| 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 | 3e85bdc155d44512be88257f76953bc86fe88a6b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width