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

openvax / pyensembl / 35021350287
89%
master: 83%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 15 Sep 2026 08:46PM UTC
Jobs 6
Files 22
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

15 Sep 2026 08:43PM UTC coverage: 87.31% (+0.3%) from 87.005%
35021350287

push

github

web-flow
Fix name-mangled other.__class typo crashing Locus/Exon comparisons (#391)

* Fix name-mangled other.__class typo crashing Locus/Exon comparisons

Locus.__eq__, __lt__, and __gt__ (locus.py) and Exon.__eq__ (exon.py)
build their TypeError message with other.__class.__name__ instead of
other.__class__.__name__. Written inside a class body, the identifier
other.__class (two leading underscores, zero trailing) gets name-mangled
to other._Locus__class / other._Exon__class, which essentially no
object has. So comparing a Locus or Exon with anything that isn't one
raised AttributeError before the intended, more informative TypeError
was ever constructed:

    >>> Locus("1", 10, 20, "+") == None
    AttributeError: 'NoneType' object has no attribute '_Locus__class'

Fixed the typo in all four spots (adding the missing trailing __).
This is the narrow, uncontroversial half of #367: the reporter also
raised a separate design question about whether __eq__ should return
NotImplemented instead of raising for foreign types (to support things
like `locus in [None, ...]` and mixed-type set/dict lookups), but
explicitly asked for maintainer input before changing that behavior
since other classes in the hierarchy (Gene, Transcript, Protein)
currently disagree on this. This PR only fixes the crash; it leaves
that broader semantics question untouched.

Added regression tests in tests/test_locus.py covering Locus == None,
Locus < None, Locus > None, Locus == 42, and Exon == None / Exon ==
"not an exon" -- all previously raised AttributeError, now correctly
raise TypeError. Verified via git stash that both new tests fail with
the exact reported AttributeError against the unpatched code, and pass
after the fix. Ran tests/test_locus.py (10 tests) and tests/test_exon_id.py
in full: no regressions (the 3 pre-existing test_exon_id.py failures
are unrelated -- they require `pyensembl install` to fetch Ensembl
release data, and fail identically on unpatched main).

Fixes #367 (t... (continued)

1 of 1 new or added line in 1 file covered. (100.0%)

1720 of 1970 relevant lines covered (87.31%)

5.24 hits per line

Jobs
ID Job ID Ran Files Coverage
1 python-3.9 - 35021350287.1 15 Sep 2026 08:48PM UTC 22
87.31
GitHub Action Run
2 python-3.12 - 35021350287.2 15 Sep 2026 08:47PM UTC 22
87.31
GitHub Action Run
3 python-3.11 - 35021350287.3 15 Sep 2026 08:46PM UTC 22
87.31
GitHub Action Run
4 python-3.14 - 35021350287.4 15 Sep 2026 08:48PM UTC 22
87.31
GitHub Action Run
5 python-3.10 - 35021350287.5 15 Sep 2026 08:47PM UTC 22
87.31
GitHub Action Run
6 python-3.13 - 35021350287.6 15 Sep 2026 08:47PM UTC 22
87.31
GitHub Action Run
Source Files on build 35021350287
  • Tree
  • List 22
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35021350287
  • 8eeb3023 on github
  • Prev Build on main (#35015041286)
  • Next Build on main (#35038430495)
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