-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Move web3.utils to web3._utils #1033
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we start taking bets on the number of issues that get open for broken imports from the utils module in user's code?
54cd2ad
to
d40314c
Compare
Can |
👍 would you be up for opening a pull request which moves it to a new |
cc @carver regarding attrdict. I see |
Yeah, this sounds like a good reason to wait to move |
Yeah, I think a small wrapper around it could go in an eth-utils minor release 👍 and then both web3 and eth-account can use the same implementation. |
Maybe we can reliably alias it? I'd be fine special casing this move and adding a deprecation warning to the |
@pipermerriam ok, I'll create PR with the data structures this weekend. |
b70ef33
to
7dcb72e
Compare
toolz, | ||
transactions, | ||
validation, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carver @pipermerriam Is this the right way to alias utils
-> _utils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion on it. Seems okay to me.
web3/utils/__init__.py
Outdated
module = importlib.util.module_from_spec(spec) | ||
loader.exec_module(module) | ||
|
||
from web3._utils import * # noqa: E402,F403,F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt work how I expect:
>>> from web3.utils.toolz import concat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'concat'
What was wrong?
web3.utils
contains code for internal use, and that could be made more clear.How was it fixed?
web3.utils
was moved toweb3._utils
Cute Animal Picture