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

source-academy / py-slang / 29985107634 / 1
86%
main: 86%

Build:
DEFAULT BRANCH: main
Ran 23 Jul 2026 06:46AM UTC
Files 116
Run time 3s
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

23 Jul 2026 06:27AM UTC coverage: 86.13%. Remained the same
29985107634.1

push

github

web-flow
Add set_timeout/clear_all_timeout to MISC (py2js) (#322)

* Add set_timeout/clear_all_timeout to MISC, implemented for py2js

Moves sound_matrix's own set_timeout(f, t)/clear_all_timeout() into the
language itself (misc.ts's MISC group) rather than keeping it module-gated
— same signature and units, needed for the tone matrix quest (Q5B).

py2js needs no cold-callback re-entry machinery to support this: a
compiled Python function already is a plain JS closure, so a real
setTimeout callback can call it directly on the event loop. Scheduled via
rt.acall (the async trampoline, not the sync call path) so a callback that
itself needs a frontend round-trip — e.g. calling an imported module
function — still works. An error raised inside a fired callback can no
longer reach the chunk that scheduled it (already resolved by then), so
it's reported through onOutput instead of silently lost. Pending timeouts
are tracked per Py2JsRuntime so clear_all_timeout only cancels the current
run's own callbacks.

CSE, PVML, and WASM aren't implemented yet — CSE has an explicit stub
("not yet supported by the CSE machine"), and both PVML and WASM fail
their own way (a PVML "primitive not implemented" RunError and a WASM
runtime NameError respectively, since each has its own separate primitive/
codegen dispatch that set_timeout was never registered in). All three are
tracked as their own follow-ups: #319 (CSE), #320 (PVML), #321 (WASM).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KrwJGug3rCXijRseRjys9V

* Fix prettier formatting in py2js-set-timeout.test.ts

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KrwJGug3rCXijRseRjys9V

* Route set_timeout/clear_all_timeout stubs through handleRuntimeError

Addresses CodeRabbit review on #322. Both stubs threw a raw JS Error
instead of the standard CSE runtime-error path (handleRuntimeError + a
RuntimeSourceError su... (continued)

4394 of 5491 branches covered (80.02%)

Branch coverage included in aggregate %.

9510 of 10652 relevant lines covered (89.28%)

178721.58 hits per line

Source Files on job 29985107634.1
  • Tree
  • List 116
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 29985107634
  • 1bc9a773 on github
  • Prev Job for on main (#29982158969.1)
  • Next Job for on main (#29994812285.1)
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