mikeshultz/ledger-eth-lib

Add type hints

Closed this issue · 5 comments

May be a simple as adding a py.typed marker, otherwise we have type ignore imports

What's missing?

I've seen these in other codebases before but didn't really know what they were for.

Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing. This marker applies recursively: if a top-level package includes it, all its sub-packages MUST support type checking as well. To have this file installed with the package, maintainers can use existing packaging options such as package_data in distutils, shown below.

Ref: https://peps.python.org/pep-0561/#packaging-type-information

Packages with a py.typed marker file - if there is nothing overriding the installed package, and it opts into type checking, the types bundled with the package SHOULD be used (be they in .pyi type stub files or inline in .py files).

Ref: https://peps.python.org/pep-0561/#type-checker-module-resolution-order

So basically this just tells mypy (or whatever) that dependents should use the types in this package? Is this blocking for you?

Not blocking but will help prevent typing related bugs downstream

Fixed in #40. Thanks @antazoey!