Skip to content

Should ArtistList implement __add__? #19890

Closed

Description

@anntzer

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, *ax.images, ...] but perhaps implementing ArtistList.__add__ may help with the transition?

Proposed Solution

Implement 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.

Additional context and prior art

N/A

Activity

  1. added this to the v3.5.0 milestone on Apr 7, 2021
  2. QuLogic commented on Apr 8, 2021

    @QuLogic
    Member

    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.

    This already triggers a deprecation warning through ArtistList.insert.

  3. added 2 commits that reference this issue on Apr 8, 2021
    e69dbe1
    cd057a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions