| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The package now ships a py.typed marker, so that type checkers use its hints, and mypy runs in the CI with its configuration in pyproject.toml. Fixing the hints of the class descriptions showed four places using a class description without checking it was there, which crashed on a stream holding a null class description. Contributes to #39. Signed-off-by: Thomas Calmant <thomas.calmant@gmail.com>
Sorry, something went wrong.
Signed-off-by: Thomas Calmant <thomas.calmant@gmail.com>
| Back | FazBrowse Home | New Git URL |
Summary
Partial answer to #39: this fixes the hints which were wrong and makes
the ones already there useful, but it does not describe every function yet.
checkers ignored its hints once installed, whatever the source contained.
It is now declared in pyproject.toml and manifest.in.
and fixing them showed a few more:
interface returned None instead of raising NotImplementedError,
unlike every other method of that class.
JavaClassDesc, but they return None when the stream holds TC_NULL.
Writing that down showed 4 places using the result without checking
it, which raised an AttributeError on such a stream: reading an
object, a class and an array now report a clear ValueError instead.
is a valid content and is kept as such.
can be None.
types job in the CI. mypy is green over the 25 modules.
implementations.
Left for 0.7
About 160 functions still have no hints, mostly in the beans, transformers
and unmarshaller of v1 and v2. That is a mechanical change over a thousand
lines, and each annotation makes mypy check the body of the function,
which surfaces more work in turn: it is better done module by module than in
the release fixing four parser bugs. check_untyped_defs and
disallow_untyped_defs are set to false in [tool.mypy] on purpose:
turning them on is the measure of that progress.
Test plan
nothing at runtime, but the 4 ValueError guards do run.
Contributes to #39