• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 42461589325
88%

Build:
DEFAULT BRANCH: main
Ran 08 Nov 2026 08:29AM UTC
Jobs 1
Files 187
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Nov 2026 08:07AM UTC coverage: 88.02% (+0.07%) from 87.953%
42461589325

push

github

web-flow
Typed Python §4, phase 1: the parser accepts type annotations (#633)

* Typed Python §4, phase 1: the parser accepts type annotations

Python §4 with type annotations (docs/typed-python-4.md, PR #630). The parser now accepts:

* annotations of the parameters of a def (`x: int`, `*xs: int`, `x: int = 1`), a return
  annotation (`-> T`; `->` is now one token) and type parameters (`def f[A, B](...)`),
* `type Name[A] = T` statements (`type` stays a soft keyword: `type = 1` is an assignment),
* a subscript with several items (`Callable[[int], int]`, `Pair[int, int]`), as in Python.

AST: FunctionParam.annotation, FunctionDef.returns and typeParams, a new TypeAlias statement.
The parameters of a lambda cannot be annotated, as in Python.

Validators: Python §1-§4 reject the new syntax (NoTypeAnnotationsValidator, with the existing
NoAnnAssignValidator), so nothing changes for them. makeTypedChapter4Validators() holds the rules
of Typed §4: every def annotates its parameters and its return type, and a declaration needs a
value. prepareTypedProgram (src/typecheck/) checks them, and eraseTypes then strips the types
(annotated assignments become assignments, type statements become pass), so that every engine
runs the program as a Python §4 program.

Tests: parsing, rejection in §1-§4, the typed rules, erasure, and the same output with and without
types on the CSE machine, py2js and PVML in the browser.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* full e-stepper: do not run annotated functions and type statements

The parser now accepts the annotations of a def, type parameters and `type` statements (Typed
Python §4). CPython evaluates annotations when the def runs, which this engine does not do yet, so
`def f(x: Undefined)` would print the result instead of raising a NameError. Report them as
unsupported, as annotated assignments already are (and only when the statement is reached).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ... (continued)

7261 of 8693 branches covered (83.53%)

Branch coverage included in aggregate %.

120 of 125 new or added lines in 17 files covered. (96.0%)

14811 of 16383 relevant lines covered (90.4%)

314739.31 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.63
-0.27% src/parser/python-grammar.ts
1
88.47
-0.15% src/engines/pvml/pvml-compiler.ts
1
85.39
-0.19% src/engines/wasm/builderGenerator.ts
1
78.03
-0.35% src/engines/wasm/metacircularGenerator.ts
Jobs
ID Job ID Ran Files Coverage
1 42461589325.1 08 Nov 2026 08:29AM UTC 187
88.02
GitHub Action Run
Source Files on build 42461589325
  • Tree
  • List 187
  • Changed 16
  • Source Changed 15
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #42461589325
  • 64c6956a on github
  • Prev Build on main (#42459101570)
  • Next Build on main (#42487950578)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc