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

Relocate web3.api and shuffle docs #1290

Merged

Conversation

njgheorghita
Copy link
Contributor

@njgheorghita njgheorghita commented Mar 19, 2019

What was wrong?

Deprecate web3.version and move non-standard jsonrpc endpoints to parity/geth specific documentation pages.

see conversation here

Cute Animal Picture

image

@njgheorghita njgheorghita requested a review from kclowes March 19, 2019 15:39
@njgheorghita njgheorghita force-pushed the relocate-web3-api-version branch 2 times, most recently from 088e603 to d4c4157 Compare March 21, 2019 14:07
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

web3/version.py Outdated
@@ -44,8 +44,7 @@ def ethereum(self):
class Version(Module):
@property
def api(self):
from web3 import __version__
return __version__
raise DeprecationWarning("This method has been deprecated as of EIP 1474.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there was a comment about raising warnings vs not in a past PR, but why are we using one over the other? Also, maybe this warning should say something like: This method has been deprecated ... Please use web3.api instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call on the warning msg! re other stuff: from here

So warnings don't break codeflow, they just dump information out so a user who's watching for them knows something is going away. Using the raise syntax breaks code flow so they are two separate mechanisms. These can be easy to mixup since the exception class is called DeprecationWarning but they are two different mechanisms that use the same class.

warning.warn(...) - for v4
raise DeprecationWarning - for v5

@njgheorghita njgheorghita force-pushed the relocate-web3-api-version branch from d4c4157 to a8bec1c Compare April 2, 2019 14:06
@njgheorghita njgheorghita merged commit a264fd0 into ethereum:master Apr 2, 2019
@njgheorghita njgheorghita deleted the relocate-web3-api-version branch April 2, 2019 14:20
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