projectfluent / python-fluent

Python implementation of Project Fluent
https://projectfluent.org/python-fluent/
Other
210 stars 26 forks source link

Add type hints to fluent.syntax & fluent.runtime #180

Closed eemeli closed 1 year ago

eemeli commented 1 year ago

Fixes #165

The work here is split into commits that may be easier to review separately. The internal hints for the runtime resolver and compiler are pretty weak, as the base implementation is making explicit use of the language being fundamentally untyped.

The bugs that are fixed are all various sorts of corner cases that the code didn't account for previously; the errors tend to follow similar cases in fluent.js.

While adding the types I used both mypy and pylance; the added CI tests only apply mypy --strict as the strict-mode pylance checks don't all pass (mostly due to using Unknown values in places that accept Any).

parmenashp commented 1 year ago

Are you planning on bumping to 0.19 after this?

eemeli commented 1 year ago

Yes.