carpedm20 / emoji

emoji terminal output for Python
Other
1.87k stars 273 forks source link

Add missing stubs for purely_emoji #287

Closed truenicoco closed 4 months ago

truenicoco commented 4 months ago

Why are there .pyi files in the first place? Aren't the type annotations in the .py files enough?

cvzi commented 4 months ago

They were necessary for Python 2.7 and 3.3 which didn't support the in-line annotations. We removed support for Python 2.7 and 3.3 recently. Probably they could all be moved from the pyi files to in-line type annotations now.

lovetox commented 4 months ago

Is anything preventing this PR to merge? We would like to use emoji, but our pipeline fails because of the type errors.

cvzi commented 4 months ago

@lovetox What do you use to check for type errors? Maybe we can add something like it to this project's CI pipeline and catch these kind of problems earlier.

lovetox commented 4 months ago

pyright for example, but you can also use mypy if its easier to use something which is python.

im not aware of any solution if you use stubs.

If you move the type annotations inline, then simply running mypy or pyright in strict mode will automatically flag all untyped methods.

cvzi commented 4 months ago

Thanks, I'll look into those