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

source-academy / py-slang / 37110161139
87%

Build:
DEFAULT BRANCH: main
Ran 03 Oct 2026 08:44AM UTC
Jobs 1
Files 145
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

03 Oct 2026 08:34AM UTC coverage: 85.719% (+0.02%) from 85.697%
37110161139

push

github

web-flow
Validation: `range` is only allowed as the callee of a for-loop header (#492)

The resolver predeclares the name `range`, so `x = range(3)`, `f = range` or
`print(range(3))` passed validation and then failed (or, on PVML, quietly
worked and produced an iterator value no other engine has) at run time, in a
different way per engine: a NameError on CSE, a leaky "ReferenceError: $range
is not defined" on py2js, a TypeError or silent success on PVML.

Add a validator that rejects every use of `range` except as the callee of a
`for` header, with a clear SyntaxError. Chapters 3 and 4 get
RangeOutsideForHeaderError ("'range' can only be used in a for-loop header");
chapters 1 and 2 have no for loops, so there `range` is just an unknown name
and gets the usual NameNotFoundError. It runs in the shared resolver, so all
engines agree at compile time.

A program that redeclares `range` and then uses it now reports a second error
for the use; the reserved-name error still comes first, and the tests check
that rather than a count of one.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

4996 of 6252 branches covered (79.91%)

Branch coverage included in aggregate %.

24 of 24 new or added lines in 4 files covered. (100.0%)

11180 of 12619 relevant lines covered (88.6%)

171725.27 hits per line

Jobs
ID Job ID Ran Files Coverage
1 37110161139.1 03 Oct 2026 08:44AM UTC 145
85.72
GitHub Action Run
Source Files on build 37110161139
  • Tree
  • List 145
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37110161139
  • 9f1e2451 on github
  • Prev Build on main (#37107803452)
  • Next Build on main (#37123180799)
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