vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
247 stars 49 forks source link

Add types for better integrating with mypy and other checkers #144

Closed antazoey closed 6 months ago

antazoey commented 6 months ago

Right now, I have import boa with a type ignore like this:

import boa  # type: ignore

It'd be nice if boa included types, even if just a little, so this wasn't necessary.

More info: https://peps.python.org/pep-0561/

antazoey commented 6 months ago

so type ignore is not needed now? for some reason I thought you needed to add py.typed to do that.

charles-cooper commented 6 months ago

so type ignore is not needed now? for some reason I thought you needed to add py.typed to do that.

hm, i was under the impression that is only needed if you want to recursively type-check against boa signatures. do you have a repro or traceback of what you are seeing?

(reference for future self: https://peps.python.org/pep-0561/#packaging-type-information)

antazoey commented 6 months ago

To ensure the issue I am raising is fixed, create any script that imports boa (outside of the boa source code):

import boa

Run mypy on this script (or project).

It will get mad because boa has not published package type stubs. A workaround is to use a type ignore:

import boa  # type: ignore

My request is to make the boa types available so I don't have to use type: ignore when importing boa. (I also didn't try this PR to check)