Skip to content

Commit 80014b3

Browse files
committed
Reorder TYPE_CHECKING imports in _accordion.py
Moved the import of Session after RecallContextManager under TYPE_CHECKING for consistency. Also made minor whitespace adjustments for code clarity.
1 parent 607f47c commit 80014b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

shiny/ui/_accordion.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
from .css._css_unit import CssUnit, as_css_unit
1616

1717
if TYPE_CHECKING:
18-
from ..session import Session
1918
from ..express._recall_context import RecallContextManager
19+
from ..session import Session
2020

2121
__all__ = (
2222
"accordion",
@@ -487,16 +487,17 @@ def insert_accordion_panel(
487487
if position not in ("after", "before"):
488488
raise ValueError("`position` must be either 'after' or 'before'")
489489
session = require_active_session(session)
490-
490+
491491
# Handle both AccordionPanel and RecallContextManager[AccordionPanel]
492492
from ..express._recall_context import RecallContextManager
493+
493494
if isinstance(panel, RecallContextManager):
494495
# This is a RecallContextManager, extract the AccordionPanel
495496
accordion_panel = panel.fn(*panel.args, **panel.kwargs)
496497
else:
497498
# This is already an AccordionPanel
498499
accordion_panel = panel
499-
500+
500501
# Add accordion ID to panel; Used when `accordion(multiple=False)`
501502
accordion_panel._accordion_id = id
502503

0 commit comments

Comments
 (0)