Skip to content

Commit 8c690e9

Browse files
Technologicatclaude
andcommitted
Type annotations: seq.py, collections.py; bugfixes and cleanups
seq.py: all 15 public items annotated — begin/begin0, lazy variants, pipe1 (Callable[[Any], Any] bodies), pipe/pipec, piped1/piped/ lazy_piped1/lazy_piped (__or__ takes Callable | sym for exitpipe sentinel), assign, do/do0 + maybe_call closure. collections.py: comprehensive pass — box, ThreadLocalBox, Some, Shim, frozendict (all methods, keys typed as Hashable), roview, view, ShadowedSequence (constructors with attribute types, all methods and closures), _SequenceReprEqMixin (renamed from _StrReprEqMixin), mogrify + doit closure, get_abcs, in_slice, index_in_slice, and private helpers (_index_in_slice, _make_negidx_converter with closures, _canonize_slice). Bugfixes: - _SequenceReprEqMixin.__eq__: now requires Sequence, raises TypeError for incompatible types (was silently crashing on non-Sized input). - roview.__init__: _cache attribute now declared (was created lazily by _update_cache, undocumented). - _make_negidx_converter.convert: explicit return None for k is None passthrough path. Also: D14 added to TODO_DEFERRED.md (flexible view variant from ancient git history). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b1e47f1 commit 8c690e9

3 files changed

Lines changed: 98 additions & 83 deletions

File tree

TODO_DEFERRED.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deferred Issues
22

3-
Next unused item code: D14
3+
Next unused item code: D15
44

55
- **D5**: `dispatch.py` — moved to GitHub issue #99. Dispatch-layer improvements for parametric ABCs (warn/error on indistinguishable multimethods). Typecheck-layer part resolved.
66

@@ -41,6 +41,9 @@ Next unused item code: D14
4141
**When to actually do it**: only if tier 1 coverage turns out to miss something important (a regression hits prod that tier 1 would not have caught). The in-thread server + scripted client approach already exercises most of the protocol surface; tier 2 is primarily a safety net for terminal-semantics and signal-path bugs. Until one of those bites, tier 1 is the main win. (Added 2026-04-15, alongside the tier 1 bring-up.)
4242

4343

44+
- **D14: Flexible view variant**: An older, more flexible implementation of `view` exists somewhere in the ancient git history, supporting more advanced slicing at the cost of worse performance. Could be resurrected as an alternative for use cases where flexibility matters more than speed. Dig through the history to find it. (Noted 2026-04-16.)
45+
46+
4447
- **D13: Teaching-friendly monad abstractions**: Port the monad hacks from https://github.com/Technologicat/python-3-scicomp-intro/tree/master/examples (monads.py) into unpythonic. `MonadicList` already exists in `amb.py` as precedent; the teaching examples include additional monad abstractions that could be generally useful. Some overlap with OSlash, but unpythonic already duplicates stdlib/third-party functionality where it adds value in its own voice (conditions/restarts, fold/scan suite). (Noted 2026-04-16.)
4548

4649

0 commit comments

Comments
 (0)