Title: [ENH]: Turn widgets.LockDraw into a context manager · Issue #24703 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Turn widgets.LockDraw into a context manager · Issue #24703 · matplotlib/matplotlib
X Title: [ENH]: Turn widgets.LockDraw into a context manager · Issue #24703 · matplotlib/matplotlib
Description: Problem lock(obj) ... lock.release(obj) will not release the lock properly if an exception occurs in between. Proposed solution We therefore should aim at with lock(obj): ... by implementing __enter__ and __exit__. Alternative: I'm quite...
Open Graph Description: Problem lock(obj) ... lock.release(obj) will not release the lock properly if an exception occurs in between. Proposed solution We therefore should aim at with lock(obj): ... by implementing __ente...
X Description: Problem lock(obj) ... lock.release(obj) will not release the lock properly if an exception occurs in between. Proposed solution We therefore should aim at with lock(obj): ... by implementing __ente...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24703
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Turn widgets.LockDraw into a context manager","articleBody":"### Problem\n\n```\r\nlock(obj)\r\n...\r\nlock.release(obj)\r\n```\r\nwill not release the lock properly if an exception occurs in between. \n\n### Proposed solution\n\nWe therefore should aim at\r\n```\r\nwith lock(obj):\r\n ...\r\n```\r\nby implementing `__enter__` and `__exit__`.\r\n\r\n\r\nAlternative: I'm quite unsure what the owner/available mechanism brings here. If that was not needed, we could use a standard `threading.Lock`.","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2022-12-12T14:11:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/24703/matplotlib/issues/24703"}
| 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:71c0bdf0-15ca-861e-4ee7-0bc9d0b30f99 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E47E:2E0804:C8F8B5:10F4DB0:6A516C9E |
| html-safe-nonce | 41a544b0259f5417a819af1d126a9f9c36ffd6fa9b50b31ea52da5181f5bb02a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDdFOjJFMDgwNDpDOEY4QjU6MTBGNERCMDo2QTUxNkM5RSIsInZpc2l0b3JfaWQiOiI2NDIyMjEwMzU4MzUwNTM5OTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f442f643279cba5643fcbae83ecd19eeb9f1c27e963c34efbad90783d7c1050e |
| hovercard-subject-tag | issue:1491981109 |
| 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/matplotlib/matplotlib/24703/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e52575a7f39b2b27e457d89a2f989ab5993baad16dd73d2eb3794a0037993074/matplotlib/matplotlib/issues/24703 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e52575a7f39b2b27e457d89a2f989ab5993baad16dd73d2eb3794a0037993074/matplotlib/matplotlib/issues/24703 |
| og:image:alt | Problem lock(obj) ... lock.release(obj) will not release the lock properly if an exception occurs in between. Proposed solution We therefore should aim at with lock(obj): ... by implementing __ente... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| 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 | 60eaaf6d4dbaa817031b556aebd8a0a7eeb81b97 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width