Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/bokeh/core/property/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,17 @@ class PropertyValueList(PropertyValueContainer, list[T]):
"""

def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
# Inline the most common fast path: single iterable argument, no kwargs
if not kwargs and len(args) == 1 and hasattr(args[0], '__iter__') and not isinstance(args[0], (str, bytes)):
# Avoid unnecessary copying if already a list
if type(args[0]) is list:
list.__init__(self, args[0])
else:
list.__init__(self, args[0])
else:
list.__init__(self, *args, **kwargs)
PropertyValueContainer.__init__(self)
# Do not call super().__init__ to avoid overhead of MRO resolution

def _saved_copy(self) -> list[T]:
return list(self)
Expand Down Expand Up @@ -261,7 +271,8 @@ def remove(self, obj):

@notify_owner
def reverse(self):
return super().reverse()
# Direct call to list.reverse for performance
return list.reverse(self)

@notify_owner
def sort(self, **kwargs):
Expand Down