Lower python version to use 3.10#9
Merged
alexachille merged 2 commits intostrands-labs:mainfrom Apr 29, 2026
Merged
Conversation
Replace PEP 695 generic syntax (class Foo[T]:, def foo[T]():) with the equivalent TypeVar/ParamSpec/Generic pattern supported since Python 3.10. This is the only change needed since no other 3.11+ features are used and all dependencies already support 3.10. Files changed: - core.py, decorator.py, types/graph.py, memory/base.py, utils/_async.py: rewrite generics to old-style TypeVar/ParamSpec/Generic - pyproject.toml: requires-python >=3.10, add 3.10/3.11 classifiers Note: This can be reverted once Python 3.11 reaches EOL (October 2027) and the minimum supported version is raised to 3.12, which natively supports PEP 695 syntax.
The hooks field passed via **agent_kwargs has type list[HookProvider] | None but Agent expects list[HookProvider | HookCallback[Any]] | None. This is a type variance issue with mutable containers — list is invariant in mypy. Add arg-type to the existing type: ignore comment to suppress it.
alexachille
approved these changes
Apr 29, 2026
Contributor
alexachille
left a comment
There was a problem hiding this comment.
Thanks! We originally set 3.12+ defensively for future flexibility, but fair point: we're not using anything beyond PEP 695, and broader version support is a win.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Lowers the minimum Python version from 3.12 to 3.10 by replacing PEP 695 generic syntax with the equivalent
TypeVar/ParamSpec/Genericpattern.Why are you making this change?
Python 3.10 and 3.11 are still actively supported (EOL Oct 2026 and Oct 2027 respectively). The only thing requiring 3.12 was PEP 695 syntax — no other 3.11+ features are used and all dependencies already support 3.10. This broadens compatibility with no functional or API changes.
Changes
core.py,decorator.py,types/graph.py,memory/base.py,utils/_async.py)requires-python >= 3.10, added 3.10/3.11 classifiersarg-typeerror on Agent hooks parameterHow was this tested?
hatch run test)hatch run format)hatch run lint)hatch run typecheck)Note
This can be reverted once Python 3.11 reaches EOL (October 2027) and the minimum is raised to 3.12, which natively supports PEP 695 syntax.
Closes #8
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.