Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable discovery of type hints as per PEP561 #10

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

cburgdorf
Copy link
Contributor

What was wrong?

The eth_typing module was born to codify stronger type guarantees for things that previously could only expressed broadly.

Example: An API should only accept things of type Hash32 instead of any bytes.

This worked fine for when we had this module as part of the Trinity code base. However, some of these types naturally spread across multiple code bases and hence we created a standalone repository (this one).

Unfortunately before PEP561 using type information from 3rd party libraries was pretty much useless and the only way to work around it was to setup stubs and make mypy aware of them.

Since we didn't have any stubs for eth-typing, ironically our effort to limit something as broadly defined as bytes now became Any (without us noticing since we don't have such strict mypy checks enabled for Trinity yet).

How was it fixed?

Configure package to distribute type information to be picked up by mypy in packages using eth-typing.

Cute Animal Picture

put a cute animal picture link inside the parentheses

@cburgdorf
Copy link
Contributor Author

cburgdorf commented Sep 12, 2018

I guess before we release this, we should probably first fix related issues in Trinity

ethereum/py-evm#1272 (comment)

Heads up @njgheorghita and @davesque you should probably check for issues in eth-pm that will result from this.

Just pull this branch locally and then to pip install -e /path/to/eth-typing/on/my/machine to figure out what parts are affected.

@pipermerriam
Copy link
Member

Lets just do a full major version bump.

@cburgdorf
Copy link
Contributor Author

Ah yes. 👍 I don't think I can do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants