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

wheerd / multiset / 8575140849 / 4
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 05 Apr 2024 08:08PM UTC
Files 2
Run time 0s
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

05 Apr 2024 08:07PM UTC coverage: 97.397% (+0.006%) from 97.391%
8575140849.4

push

github

web-flow
Support mypy typing (#127)

* Support mypy typing

The big change here is to convert the library from a "single file module"
to a "packages" module. Here there is only only one package and we use an
__init__.py with `from .multiset import *` to continue to allow `from
multiset import Multiset` and similar. As crazy as it sounds I don't think
there's any way to signal to mypy with the py.typed file that the library
has type stubs without restructuring like this.

I also made some small changes to multiset.pyi to bring it in line with what
mypy wants.

A wheel package built with `python -m build` or `python -m build --wheel`
will now create a directory under site-packages containing multiset.py,
multiset.pyi, and py.typed, rather than just putting multiset.py into
site-packages as it did previously. If we publish this on pypi, clients of
the library will be able to use it typed without `type: ignore` comments
and will be able to type their Multisets like this and catch more bugs as
well as not getting told off by mypy:

```
from multiset import Multiset

m = Multiset[int | float] = Multiset([1, 2.2, 9, 33.8])
m1.add("hello")  # mypy says 'Argument 1 to "add" of "Multiset" has incompatible type "str"; expected "int | float"'
```

Cool!

* Update Makefiles with new location of code

---------

Co-authored-by: Manuel Krebber <admin@wheerd.de>

221 of 252 branches covered (87.7%)

449 of 461 relevant lines covered (97.4%)

0.97 hits per line

Source Files on job run-3.8 - 8575140849.4
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 8575140849
  • 73e3b4e0 on github
  • Prev Job for on master (#8575022051.6)
  • Next Job for on master (#8575477637.)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc