Title: Assertion failed: table.sub_tables.is_empty() when decorator class takes a lambda argument. · Issue #4856 · RustPython/RustPython · GitHub
Open Graph Title: Assertion failed: table.sub_tables.is_empty() when decorator class takes a lambda argument. · Issue #4856 · RustPython/RustPython
X Title: Assertion failed: table.sub_tables.is_empty() when decorator class takes a lambda argument. · Issue #4856 · RustPython/RustPython
Description: The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer value 3. Then RustPython crashes with an ass...
Open Graph Description: The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer valu...
X Description: The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer valu...
Opengraph URL: https://github.com/RustPython/RustPython/issues/4856
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assertion failed: table.sub_tables.is_empty() when decorator class takes a lambda argument.","articleBody":"The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer value 3. Then RustPython crashes with an assertion error.\r\n\r\ntest.py\r\n```\r\nimport unittest\r\nfrom unittest import mock\r\n\r\nclass MockedA(BaseFTests):\r\n pass\r\n\r\n@mock.patch(\"\", lambda: 3)\r\nclass MockedB(MockedA):\r\n def _asserts(self, val):\r\n pass\r\n```\r\n\r\nCrash message:\r\n```\r\nthread 'main' panicked at 'assertion failed: table.sub_tables.is_empty()', compiler/codegen/src/compile.rs:308:9\r\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\r\n```\r\n\r\nEnvironment:\r\nUbuntu 18.04\r\nrustpython v0.2.0\r\n","author":{"url":"https://github.com/xiaxinmeng","@type":"Person","name":"xiaxinmeng"},"datePublished":"2023-04-06T11:01:44Z","url":"https://github.com/RustPython/RustPython/issues/4856"}
| 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:f9d49f4b-7af9-98db-c370-0a836b96894c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDC2:3A7693:22DFF10:2F50989:6B00271A |
| html-safe-nonce | 59aae9495d671ce1c4547bdf058dbef301d5caa51f4bd4000183725dff589001 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREMyOjNBNzY5MzoyMkRGRjEwOjJGNTA5ODk6NkIwMDI3MUEiLCJ2aXNpdG9yX2lkIjoiMTczNTMxNDA3OTk2NDMwMTA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b377774e8406a7ae265e262b52acbaa5fb0ca69fcca562c3905205c0d64d7d2d |
| hovercard-subject-tag | issue:1657202750 |
| 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/RustPython/RustPython/4856/issue_layout |
| twitter:image | https://opengraph.githubassets.com/386a4fc9674baa02d59dd55a580a41b960d9418b90cf08b4f366e990d994300b/RustPython/RustPython/issues/4856 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/386a4fc9674baa02d59dd55a580a41b960d9418b90cf08b4f366e990d994300b/RustPython/RustPython/issues/4856 |
| og:image:alt | The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer valu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xiaxinmeng |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width