Skip to content

Commit cfa09d7

Browse files
authored
Add PyComponent.__panel__ stub (#8271)
* Add PyComponent.__panel__ stub * Typing tweaks
1 parent 5076b55 commit cfa09d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

panel/custom.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
import sys
1010
import textwrap
1111

12+
from abc import abstractmethod
1213
from collections import defaultdict
13-
from collections.abc import Callable, Mapping
14+
from collections.abc import (
15+
Awaitable, Callable, Iterator, Mapping,
16+
)
1417
from functools import partial
1518
from typing import (
1619
TYPE_CHECKING, Any, ClassVar, Literal,
@@ -165,6 +168,9 @@ def select(
165168
self._view__ = self._create__view()
166169
return super().select(selector) + self._view__.select(selector)
167170

171+
@abstractmethod
172+
def __panel__(self) -> Viewable | Iterator[Viewable] | Awaitable[Viewable]:
173+
raise NotImplementedError
168174

169175

170176
class ReactiveESMMetaclass(ReactiveMetaBase):

0 commit comments

Comments
 (0)