Open
Conversation
ty cannot understand some literal collections types, i.e. `{'a': 1}`
being `dict[str, int]`, so we say it. Same for lambdas even typed with
`Callable[...]` and some builtins.
- simply more tests - add type tests coverage check
- Separate type stubs docs into CLAUDE_TYPES.md for progressive discovery - Replace GEMINI.md with symlink to CLAUDE.md - Fix PYIH.md naming (pyi higher) and remove resolved FIX comments - Add XPred variant type tests for select_keys, select_values, split_keys, some - Document ty TypeVar unification bug with proper XFAIL markers - Refactor type_tests/run.py: extract validate_file(), find_stale_xfails() - Refactor translate_pyih.py: extract extract_xfunc_skip(), remove .copy() - Add RES comments for translate_pyih string-vs-AST refactoring (too large) - Add split_keys to extended_fns.rst function list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hashable correctly constrains is_distinct's element/key types since the implementation uses sets internally, requiring hashable values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- select now uses XPred for list/set/frozenset, Callable for dict/Mapping - Added MutableMapping overloads to select, select_keys, select_values - Added type tests for new overloads including MutableMapping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
walk with Mapping/MutableMapping input returns dict. Added typed pair-function overloads and corresponding type tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Existing XFunc overloads already handle pairs correctly via TypeVar inference. Added tests to verify and removed resolved FIX comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…values walk_keys/walk_values now support MutableMapping (returning dict) and collection-of-pairs (list/set/frozenset of tuples, preserving type). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
compact now has specific overloads for list/set/frozenset, dict, MutableMapping, and Mapping, with a catch-all fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
flip/project/omit now support MutableMapping. flip also supports collections of pairs (list/set/frozenset of tuples). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both functions now accept list/set/frozenset of tuples with full XPred expansion, in addition to dict/MutableMapping/Mapping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also add coverage command reference to CLAUDE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The .pyih translator tests parse PEP 695 type parameter syntax which requires Python 3.12+. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This simplifies all catch-all overloads from `Callable[..., Any] | _Func` to just `_XFunc`, since the two were always used together. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures dict/MutableMapping/Mapping types are preserved when using extended function predicates with select, matching the pattern used by walk. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Callable parameter now correctly requires list[_W] matching the dict values type _W, catching mismatches. Added tests for same type, wider (Iterable), and wrong type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
compact(list[int | None]) now returns list[int], compact(dict[str, int | None]) returns dict[str, int], etc. Only applies to invariant types (dict, MutableMapping, list, tuple, set, frozenset) — covariant types like Sequence would swallow non-None inputs via subtyping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Use Claude Code + Opus 4.6 a lot. Sonnet just doesn't get it ;)