Skip to content

Refactor session_list to return session references separately#18

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/fix-session-list-error-Q9HmG
Mar 11, 2026
Merged

Refactor session_list to return session references separately#18
stevevanhooser merged 1 commit into
mainfrom
claude/fix-session-list-error-Q9HmG

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Summary

Modified the session_list() method to return session references as a separate list alongside the session details, improving API usability and enabling more efficient access to session reference strings.

Key Changes

  • Changed return type from list[dict[str, Any]] to tuple[list[str], list[dict[str, Any]]]
  • Extracted session reference strings into a dedicated list returned as the first element of the tuple
  • Refactored internal logic to build both session_references and session_list during iteration
  • Updated docstring to document the new tuple return format with clear descriptions of each component

Implementation Details

  • Session references are now extracted once during iteration and stored in a separate list for efficient access
  • The session reference value is reused in the session dict to avoid redundant property lookups
  • The method maintains backward compatibility in terms of data content while changing the return structure

https://claude.ai/code/session_011dfeoCuRP6gCP6R9FYk2rH

The method previously returned a single list, causing a ValueError when
unpacking into two variables (sessrefs, sesslist = D.session_list()).
Now returns a tuple matching the MATLAB convention.

https://claude.ai/code/session_011dfeoCuRP6gCP6R9FYk2rH
@stevevanhooser stevevanhooser merged commit 82aa2c8 into main Mar 11, 2026
1 of 4 checks passed
@stevevanhooser stevevanhooser deleted the claude/fix-session-list-error-Q9HmG branch March 11, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants