Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd type hints to web3.main #1488
Merged
Conversation
d993ac2
to
f4ea824
web3/main.py
Outdated
return self.codec.is_encodable(_type, value) | ||
|
||
@property | ||
def ens(self): | ||
def ens(self) -> Union[ENS, Empty]: |
This comment has been minimized.
This comment has been minimized.
njgheorghita
Nov 1, 2019
Author
Contributor
I'm not sure if there's a better way to handle this, since it should always be returning only ENS
- but since web3.ens
is set to a default Empty
type in the constructor args, this seems like the only way to make mypy happy.
This comment has been minimized.
This comment has been minimized.
f4ea824
to
1d2797d
1d2797d
to
1068f8e
web3/main.py
Outdated
return self.codec.is_encodable(_type, value) | ||
|
||
@property | ||
def ens(self): | ||
def ens(self) -> Union[ENS, Empty]: |
This comment has been minimized.
This comment has been minimized.
web3/main.py
Outdated
def __init__( | ||
self, | ||
provider: BaseProvider=None, | ||
middlewares: List[Any]=None, |
This comment has been minimized.
This comment has been minimized.
web3/main.py
Outdated
self, | ||
provider: BaseProvider=None, | ||
middlewares: List[Any]=None, | ||
modules: Dict[str, Iterable[Any]]=None, |
This comment has been minimized.
This comment has been minimized.
6c0256a
into
ethereum:master
29 checks passed
29 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
njgheorghita commentedNov 1, 2019
•
edited
What was wrong?
Start adding mypy type hints to
web3
- starting withweb3.main
.Todo:
Cute Animal Picture