I got tired of print(x.shape) so I built runtime type hints for Python
Details
- External ID
- 47428060
- Source
- HN
- Company
- —
- Product
- I got tired of print(x.shape) so I built runtime type hints for Python
- Website domain
- github.com
- Launched
- March 18, 2026
- Cohort
- —
- Upvotes
- 7
- Upvotes percentile
- 0.4108241082410824
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
As a beginner learning to build ML models, I found it annoying to have to keep printing tensor shapes every other line, having to step through the debugger to check where did I mess up the shapes again.So I built Trickle, it takes the data that flows through your code, caches the types and display them inline (as if you have type annotations).The idea is: "Let types trickle from runtime into your IDE". You get types in Python without having the write them manually.It works by rewriting your Python AST at import time — after every variable assignment, it inserts a lightweight call that records the type and value. No decorators, no code changes. Just run your script through trickle run python train.py and every variable gets its type visible.One cool feature is Error snapshots, by toggling it in VSCode status bar, you can see the exact data that is in each variable when the error happened.For AI agents, trickle-cli outputs the inline runtime types together with the source code so agent can better diagnose the issue.For Jupyter notebooks: %load_ext trickle as your first cell, and every cell after is traced.Quick try: pip install trickle-observe npm install -g trickle-cli code --install-extension yiheinchai.trickle-vscode trickle run python demo/demo.py trickle hints demo/demo.py Limitations: - Expect 2-5x slowdown — designed for development, not production.Also supports JavaScript/TypeScript (Express, Fastify, Koa, Hono) though the Python/ML side is where I've focused most effort.In the future, I imagine there to be potential for using this as runtime observability in production via probabilistic sampling of types. Now, we know the code, we know the data, which is all the information we need to debug.Happy to answer questions
Enrichment
- Theme
- niche developer utilities and toolchains
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- runtime type hints for python
- Manually corrected
- False
Could you build this?
No Building a dynamic runtime inspection tool that hooks Python execution, tracks tensor shapes across execution frames, and renders inline hints requires deep knowledge of Python bytecode/sys.settrace or language server (LSP) internals.
What it would actually take: This requires a Python trace profiler using `sys.settrace` or PEP 669 monitoring APIs to inspect local variable assignments and extract `.shape`/`type()` without unacceptable performance overhead. It also necessitates a companion VS Code extension or LSP plugin to communicate with the runtime cache via IPC and render decorative virtual text (inlay hints) precisely at source code positions.
Discussion
1 comment analyzed.
Competitors
Other products that read as similar to this one — 73 launches clear the similarity bar, closest 8 shown.
Attention rank: #44 of 74 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 135 days after the earliest competitor.
- I built Wool, a lightweight distributed Python runtime · hn · 2026-03-14 · 15 upvotes · similarity 0.45
- Typical is TypeScript with type-safety at runtime · hn · 2026-01-11 · 8 upvotes · similarity 0.44
- Python Code Editor & IDE · ph · 2026-09-27 · 1 upvotes · similarity 0.42
- Genotype: language that compiles to idiomatic TS, Rust and Python · hn · 2026-09-08 · 9 upvotes · similarity 0.42
- Xpandas · hn · 2026-03-02 · 6 upvotes · similarity 0.41
- PEP 827 · hn · 2026-03-02 · 7 upvotes · similarity 0.40
- I embedded 685M public texts in 32 minutes (on 8x A100, Rust, TensorRT) · hn · 2026-06-04 · 7 upvotes · similarity 0.39
- I created a RAW to HDRI stacker in (mostly) Common Lisp · hn · 2026-06-05 · 35 upvotes · similarity 0.39
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.