Title: Syntactic sugar for property access · Issue #274 · python-xlib/python-xlib · GitHub
Open Graph Title: Syntactic sugar for property access · Issue #274 · python-xlib/python-xlib
X Title: Syntactic sugar for property access · Issue #274 · python-xlib/python-xlib
Description: Heyas! This is a solicitation for comments before I make a PR: For my window manager, I have made a wrapper for python-xlib that adds a lot of convenience syntax sugar stuff. This does a lot of monkey patching, and I'd like to contribute...
Open Graph Description: Heyas! This is a solicitation for comments before I make a PR: For my window manager, I have made a wrapper for python-xlib that adds a lot of convenience syntax sugar stuff. This does a lot of mon...
X Description: Heyas! This is a solicitation for comments before I make a PR: For my window manager, I have made a wrapper for python-xlib that adds a lot of convenience syntax sugar stuff. This does a lot of mon...
Opengraph URL: https://github.com/python-xlib/python-xlib/issues/274
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Syntactic sugar for property access","articleBody":"Heyas!\r\n\r\nThis is a solicitation for comments before I make a PR:\r\n\r\nFor my window manager, I have made a wrapper for python-xlib that adds a lot of [convenience syntax sugar stuff](https://github.com/redhog/InfiniteGlass/blob/master/docs/LIBRARY.md). This does a lot of monkey patching, and I'd like to contribute this back to python-xlib as added methods to the core classes instead. None of this changes existing functionality, it just adds.\r\n\r\nIn particular, property access to windows is greatly simplified by having windows work as dictionaries of their properties, supporting all the usual operations (keys(), items(), in, win[name] = value etc). The dictionary keys are the python string equivalents of the ATOM:s.\r\n\r\nValues are converted to/from python equivalents as needed to be convenient:\r\n`WINDOW` are returned as\r\n`Xlib.xobject.drawable.Window` objects, `ATOM`s, `KEYCODE`s and `XCONST`s as python `string`s, `STRING`s as `bytes`s. Properties with length != 1 are converted to/from `list`s of the corresponding values.\r\n\r\nI forsee some of these changes to be more easily accepted than other ones, so please feel free to browse through the above link and write here what you like and dislike!","author":{"url":"https://github.com/redhog","@type":"Person","name":"redhog"},"datePublished":"2024-07-10T14:17:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/274/python-xlib/issues/274"}
| 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:d5ca84b1-6dc0-99ab-dbfe-906a73129c11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ACA:FE136:3418709:34CE33F:697038A3 |
| html-safe-nonce | bb8fd17d74a87f802aae6f058f5fc061f528b22c2cf363cc0bd0e216661076b2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUNBOkZFMTM2OjM0MTg3MDk6MzRDRTMzRjo2OTcwMzhBMyIsInZpc2l0b3JfaWQiOiIyNTc2MTg4NTAzMzYzNjk2ODAzIiwicmVnaW9uX2VkZ2UiOiJzZWEiLCJyZWdpb25fcmVuZGVyIjoic2VhIn0= |
| visitor-hmac | d223dd0fcdd9a1733bfe523d0cc7a3ad83ca6bba843873a49603b51c6d76afdd |
| hovercard-subject-tag | issue:2400905996 |
| 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/python-xlib/python-xlib/274/issue_layout |
| twitter:image | https://opengraph.githubassets.com/199d2a91e4499af868c5e1dc18ab3ccc0748b89532b9ea40bf199468ba861e03/python-xlib/python-xlib/issues/274 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/199d2a91e4499af868c5e1dc18ab3ccc0748b89532b9ea40bf199468ba861e03/python-xlib/python-xlib/issues/274 |
| og:image:alt | Heyas! This is a solicitation for comments before I make a PR: For my window manager, I have made a wrapper for python-xlib that adds a lot of convenience syntax sugar stuff. This does a lot of mon... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | redhog |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-xlib/python-xlib git https://github.com/python-xlib/python-xlib.git |
| octolytics-dimension-user_id | 16151530 |
| octolytics-dimension-user_login | python-xlib |
| octolytics-dimension-repository_id | 47391866 |
| octolytics-dimension-repository_nwo | python-xlib/python-xlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 47391866 |
| octolytics-dimension-repository_network_root_nwo | python-xlib/python-xlib |
| 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 | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width