Skip to content

Import abstract base classes from collections.abc instead of typing#133

Merged
dhruvbatra merged 1 commit into
mainfrom
claude/happy-fermi-u0m4bx
Jun 15, 2026
Merged

Import abstract base classes from collections.abc instead of typing#133
dhruvbatra merged 1 commit into
mainfrom
claude/happy-fermi-u0m4bx

Conversation

@dhruvbatra

@dhruvbatra dhruvbatra commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Callable, Iterable, Iterator, Mapping, and Sequence have been deprecated as typing aliases since Python 3.9 (PEP 585), with the canonical home being collections.abc. This PR moves those imports to collections.abc across the SDK.

Files updated:

  • yutori/_async/chat.pyIterable
  • yutori/_sync/chat.pyIterable
  • yutori/navigator/loop.pyIterable
  • yutori/navigator/payload.pyCallable
  • yutori/navigator/coordinates.pySequence
  • yutori/cli/commands/__init__.pyIterator
  • yutori/cli/commands/install_flow.pyMapping, Sequence
  • yutori/auth/flow.pyCallable

Safety

  • Import-only, behavior-preserving change.
  • PEP 585 makes the collections.abc forms subscriptable at runtime since Python 3.9, matching the package's requires-python = ">=3.9". The change is therefore safe across the full 3.9–3.13 CI matrix, regardless of whether a module uses from __future__ import annotations.
  • ruff check . passes (including import-order rule I).
  • Verified the edited modules parse and coordinates.py runs correctly.

Generated by Claude Code


Note

Low Risk
Import-only, behavior-preserving change aligned with the package’s Python ≥3.9 support; no logic or API surface changes.

Overview
Updates type-only imports to follow PEP 585: abstract collection types that were deprecated on typing since Python 3.9 now come from collections.abc instead.

Touched areas include sync/async chat completions (Iterable), Navigator helpers (Iterable, Callable, Sequence), OAuth login (Callable), and CLI install/error helpers (Iterator, Mapping, Sequence). Annotations and call sites are unchanged; only import lines were split or rewired.

Reviewed by Cursor Bugbot for commit 926aa28. Bugbot is set up for automated code reviews on this repo. Configure here.

Callable, Iterable, Iterator, Mapping, and Sequence have been deprecated
as typing aliases since Python 3.9 (PEP 585). Move these imports to
collections.abc across the SDK. All edits are import-only and behavior-
preserving; PEP 585 makes the collections.abc forms subscriptable at
runtime on Python 3.9+, matching the package's requires-python >=3.9.
@dhruvbatra dhruvbatra merged commit be99d79 into main Jun 15, 2026
9 checks passed
@dhruvbatra dhruvbatra deleted the claude/happy-fermi-u0m4bx branch June 15, 2026 00:16
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