ethereum / py-ssz

Python implementation of the Simple Serialize encoding and decoding
MIT License
32 stars 22 forks source link

Add type hints #8

Open jannikluhn opened 5 years ago

jannikluhn commented 5 years ago

We should add type hints and check them in CI.

Bhargavasomu commented 5 years ago

I will take this up once #17 is merged.

jannikluhn commented 5 years ago

@Bhargavasomu Note that most of this should be done already in #22.

hwwhww commented 5 years ago

@Bhargavasomu would you like to take it + enable mypy in tox?

Bhargavasomu commented 5 years ago

@hwwhww I will take this up.

jannikluhn commented 5 years ago

There's not a lot of documentation and it's unstable, but if we want to have type hints for Serializable.__init__ (which I think we should), we probably have to write a mypy plugin.

pacrob commented 9 months ago

There are a lot of types throughout the lib, but it doesn't appear that mypy checks were ever run as part of CI. With the incoming template updates, mypy is being added as part of the pre-commit checks, but with the ssz folder excluded. As files are typed, they can be added to be checked. See pre-commit docs