Skip to content

Commit

Permalink
type: Return Self for .servable (#7530)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Dec 3, 2024
1 parent 7afcc90 commit d8587ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion panel/template/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
from bokeh.server.contexts import BokehSessionContext
from jinja2 import Template as _Template
from pyviz_comms import Comm
from typing_extensions import Self

from ..io.location import Location
from ..io.resources import ResourcesType
Expand Down Expand Up @@ -506,7 +507,7 @@ def server_doc(
def servable(
self, title: str | None = None, location: bool | Location = True,
area: str = 'main', target: str | None = None
) -> ServableMixin:
) -> Self:
"""
Serves the template and returns self to allow it to display
itself in a notebook context.
Expand Down
3 changes: 2 additions & 1 deletion panel/viewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
from bokeh.model import Model
from bokeh.server.contexts import BokehSessionContext
from bokeh.server.server import Server
from typing_extensions import Self

from .io.location import Location
from .io.notebook import Mimebundle
Expand Down Expand Up @@ -359,7 +360,7 @@ def _add_location(
def servable(
self, title: str | None = None, location: bool | Location = True,
area: str = 'main', target: str | None = None
) -> ServableMixin:
) -> Self:
"""
Serves the object or adds it to the configured
pn.state.template if in a `panel serve` context, writes to the
Expand Down

0 comments on commit d8587ab

Please sign in to comment.