Title: Should ArtistList implement `__add__`? · Issue #19890 · matplotlib/matplotlib · GitHub
Open Graph Title: Should ArtistList implement `__add__`? · Issue #19890 · matplotlib/matplotlib
X Title: Should ArtistList implement `__add__`? · Issue #19890 · matplotlib/matplotlib
Description: Problem ArtistList (#18216) is great :) but I realized that I had a few places in my old programs where I was doing e.g. ax.lines + ax.images + ..., which now breaks because there's no ArtistList.__add__. Instead one can do [*ax.lines, *...
Open Graph Description: Problem ArtistList (#18216) is great :) but I realized that I had a few places in my old programs where I was doing e.g. ax.lines + ax.images + ..., which now breaks because there's no ArtistList._...
X Description: Problem ArtistList (#18216) is great :) but I realized that I had a few places in my old programs where I was doing e.g. ax.lines + ax.images + ..., which now breaks because there's no ArtistLi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19890
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should ArtistList implement `__add__`?","articleBody":"\u003c!--\r\nWelcome! Thanks for thinking of a way to improve Matplotlib.\r\n\r\n\r\nBefore creating a new feature request please search the issues for relevant feature requests.\r\n--\u003e\r\n\r\n### Problem\r\n\r\nArtistList (#18216) is great :) but I realized that I had a few places in my old programs where I was doing e.g. `ax.lines + ax.images + ...`, which now breaks because there's no `ArtistList.__add__`. Instead one can do `[*ax.lines, *ax.images, ...]` but perhaps implementing `ArtistList.__add__` may help with the transition?\r\n\r\n### Proposed Solution\r\n\r\nImplement `ArtistList.__add__` (which should only add ArtistLists and/or lists, and return plain lists). `ArtistList.__iadd__` should probably also be implemented as throwing an exception (or emitting a deprecation warning), as direct modification of ArtistLists is currently being deprecated.\r\n\r\n### Additional context and prior art\r\n\r\nN/A","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2021-04-07T09:57:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/19890/matplotlib/issues/19890"}
| 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:31032fa9-bfd9-8336-bbbd-3e538a9ec6b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99C4:1159AF:B74948:F629F7:6A52C15B |
| html-safe-nonce | a310929991e9874bf03b5905d58efdd3b42a639347e34ed586a7bd17c7bf10be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUM0OjExNTlBRjpCNzQ5NDg6RjYyOUY3OjZBNTJDMTVCIiwidmlzaXRvcl9pZCI6IjYzNjE1NjAwNjQzMDY4ODkwNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c9f9ba1346022b0cf019ea8207831d5b35fa6e5478c9e31c9f9d8c0004671eeb |
| hovercard-subject-tag | issue:852237473 |
| 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/19890/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6ad6c05e662c64a3f4dfef4e6584ebed74ec5eb4ca0adf239f1fa240fb7fa698/matplotlib/matplotlib/issues/19890 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6ad6c05e662c64a3f4dfef4e6584ebed74ec5eb4ca0adf239f1fa240fb7fa698/matplotlib/matplotlib/issues/19890 |
| og:image:alt | Problem ArtistList (#18216) is great :) but I realized that I had a few places in my old programs where I was doing e.g. ax.lines + ax.images + ..., which now breaks because there's no ArtistList._... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width