@@ -388,16 +388,12 @@ def __iadd__(self, other: Iterable[Any]) -> ListLike:
388
388
def __add__ (self , other : Iterable [Any ]) -> ListLike :
389
389
if isinstance (other , ListLike ):
390
390
other = other .objects
391
- else :
392
- other = list (other )
393
- return self .clone (* (self .objects + other ))
391
+ return self .clone (* self .objects , * other )
394
392
395
393
def __radd__ (self , other : Iterable [Any ]) -> ListLike :
396
394
if isinstance (other , ListLike ):
397
395
other = other .objects
398
- else :
399
- other = list (other )
400
- return self .clone (* (other + self .objects ))
396
+ return self .clone (* other , * self .objects )
401
397
402
398
def __contains__ (self , obj : Viewable ) -> bool :
403
399
return obj in self .objects
@@ -644,23 +640,23 @@ def __iadd__(self, other: Iterable[Any]) -> NamedListLike:
644
640
645
641
def __add__ (self , other : Iterable [Any ]) -> NamedListLike :
646
642
if isinstance (other , NamedListLike ):
647
- added = list ( zip (other ._names , other .objects ) )
643
+ added = zip (other ._names , other .objects )
648
644
elif isinstance (other , ListLike ):
649
645
added = other .objects
650
646
else :
651
- added = list ( other )
652
- objects = list ( zip (self ._names , self .objects ) )
653
- return self .clone (* ( objects + added ) )
647
+ added = other
648
+ objects = zip (self ._names , self .objects )
649
+ return self .clone (* objects , * added )
654
650
655
651
def __radd__ (self , other : Iterable [Any ]) -> NamedListLike :
656
652
if isinstance (other , NamedListLike ):
657
- added = list ( zip (other ._names , other .objects ) )
653
+ added = zip (other ._names , other .objects )
658
654
elif isinstance (other , ListLike ):
659
655
added = other .objects
660
656
else :
661
- added = list ( other )
662
- objects = list ( zip (self ._names , self .objects ) )
663
- return self .clone (* ( added + objects ) )
657
+ added = other
658
+ objects = zip (self ._names , self .objects )
659
+ return self .clone (* added , * objects )
664
660
665
661
def __setitem__ (self , index : int | slice , panes : Iterable [Any ]) -> None :
666
662
new_objects = list (self )
0 commit comments