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

beartype / plum / 33735604152
99%

Build:
DEFAULT BRANCH: master
Ran 03 Sep 2026 08:51AM UTC
Jobs 7
Files 16
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 Sep 2026 08:51AM UTC coverage: 99.333% (-0.2%) from 99.507%
33735604152

push

github

web-flow
fix: Any must not collide with concrete types under beartype>=0.23 (#296)

Fixes #295.

Since `beartype` 0.23.0rc0, `is_subhint(Any, T)` is `True` for every `T`, a
deliberate change matching mypy's two-way assignability semantics for `Any`.
`TypeHint.__eq__` is built from that relation, so `TypeHint(Any) == TypeHint(T)`
became `True` as well. Plum uses those comparisons for two different things.
Dispatch matching wants assignability and is correct as is. Signature
bookkeeping — "is this the same registered signature" (`Signature.__eq__`) and
"is this strictly more specific" (`Signature.__le__`) — needs `Any` to stay a
distinct, least specific type.

Since an unannotated parameter resolves to `Any`, the collision surfaced twice.
Registration silently overwrote the wrong method, in either order and without a
`MethodRedefinitionWarning`, which destroyed plum's own conversion fallback the
moment the package finished importing and broke `plum.convert` globally. And
specificity ordering became registration-order dependent, so a generic `f(x)`
and a specific `f(x: int)` were mutually comparable but neither strictly more
specific, and whichever was registered last won.

Two helpers in `_type.py` fix this. `_type_hint_le` is
`beartype.door.TypeHint(x) <= TypeHint(y)` except that `Any` is a subhint only
of itself, so `X <= Any` still holds for every `X` and `Any` stays the top of
the ordering; `_type_hint_eq` is the corresponding equality. They are used in
`Signature.__eq__`, in both branches of `Signature.__le__`, and in
`add_promotion_rule`'s reverse-rule check. Nothing else changes, so `beartype`'s
assignability semantics are untouched for `Signature.match`, `is_bearable`, and
the public `plum.issubclass`/`plum.isinstance`.

A root `Any` is not the only case. `beartype>=0.23` collapses `list[Any]` onto
`list[int]` exactly as it collapses `Any` onto `int`, so `_substitute_any`
rewrites every nested `Any` to `object` before delegating. For bookkeeping,
`object... (continued)

50 of 52 new or added lines in 4 files covered. (96.15%)

1043 of 1050 relevant lines covered (99.33%)

6.72 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
98.86
-1.14% src/plum/_type.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.14-pre-beartype - 33735604152.1 03 Sep 2026 08:51AM UTC 16
99.28
GitHub Action Run
2 run-3.13 - 33735604152.2 03 Sep 2026 08:51AM UTC 16
98.84
GitHub Action Run
3 run-3.12 - 33735604152.3 03 Sep 2026 08:52AM UTC 16
98.84
GitHub Action Run
4 run-3.13-pre-beartype - 33735604152.4 03 Sep 2026 08:52AM UTC 16
98.84
GitHub Action Run
5 run-3.11 - 33735604152.5 03 Sep 2026 08:52AM UTC 16
98.84
GitHub Action Run
6 run-3.14 - 33735604152.6 03 Sep 2026 08:51AM UTC 16
99.28
GitHub Action Run
7 run-3.10 - 33735604152.7 03 Sep 2026 08:52AM UTC 16
98.84
GitHub Action Run
Source Files on build 33735604152
  • Tree
  • List 16
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33735604152
  • c44e0cf7 on github
  • Prev Build on master (#33695235462)
  • Next Build on master (#33876858524)
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