Skip to content

Commit 039e40a

Browse files
aherzfeldkclowes
authored andcommitted
converted Web3 instance variables to 'w3'. (ethereum#1186)
* converted Web3 instance variables to 'w3'. * changed web3 instances to w3 * changed web3 instance variables to w3
1 parent f01bfcf commit 039e40a

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

docs/internals.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ a list when instantiating your ``Web3`` object.
8787

8888
.. code-block:: python
8989
90-
>>> web3 = Web3([provider_a, provider_b])
90+
>>> w3 = Web3([provider_a, provider_b])
9191
9292
9393
@@ -145,7 +145,7 @@ business logic for web3 requests. Writing middleware is simple.
145145

146146
.. code-block:: python
147147
148-
def simple_middleware(make_request, web3):
148+
def simple_middleware(make_request, w3):
149149
# do one-time setup operations here
150150
151151
def middleware(method, params):
@@ -167,8 +167,8 @@ It is also possible to implement middlewares as a class.
167167
.. code-block:: python
168168
169169
class SimpleMiddleware:
170-
def __init__(self, make_request, web3):
171-
self.web3 = web3
170+
def __init__(self, make_request, w3):
171+
self.w3 = w3
172172
self.make_request = make_request
173173
174174
def __call__(self, method, params):

docs/overview.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ local development this would be something like ``ws://127.0.0.1:8546``.
3636
# Note that you should create only one RPCProvider per
3737
# process, as it recycles underlying TCP/IP network connections between
3838
# your process and Ethereum node
39-
>>> web3 = Web3(HTTPProvider('http://localhost:8545'))
39+
>>> w3 = Web3(HTTPProvider('http://localhost:8545'))
4040
4141
# or for an IPC based connection
42-
>>> web3 = Web3(IPCProvider())
42+
>>> w3 = Web3(IPCProvider())
4343
4444
# or for Websocket based connection
45-
>>> web3 = Web3(WebsocketProvider('ws://127.0.0.1:8546'))
45+
>>> w3 = Web3(WebsocketProvider('ws://127.0.0.1:8546'))
4646
4747
4848
Base API
@@ -207,7 +207,7 @@ Addresses
207207

208208
.. code-block:: python
209209
210-
>>> web3.isAddress('0xd3CdA913deB6f67967B99D67aCDFa1712C293601')
210+
>>> wch3.isAddress('0xd3CdA913deB6f67967B99D67aCDFa1712C293601')
211211
True
212212
213213
@@ -218,9 +218,9 @@ Addresses
218218

219219
.. code-block:: python
220220
221-
>>> web3.isChecksumAddress('0xd3CdA913deB6f67967B99D67aCDFa1712C293601')
221+
>>> wch3.isChecksumAddress('0xd3CdA913deB6f67967B99D67aCDFa1712C293601')
222222
True
223-
>>> web3.isChecksumAddress('0xd3cda913deb6f67967b99d67acdfa1712c293601')
223+
>>> wch3.isChecksumAddress('0xd3cda913deb6f67967b99d67acdfa1712c293601')
224224
False
225225
226226

docs/providers.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ HTTPProvider
210210
.. code-block:: python
211211
212212
>>> from web3 import Web3
213-
>>> web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))
213+
>>> w3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))
214214
215215
Note that you should create only one HTTPProvider per python
216216
process, as the HTTPProvider recycles underlying TCP/IP network connections,
@@ -225,7 +225,7 @@ HTTPProvider
225225
.. code-block:: python
226226
227227
>>> from web3 import Web3
228-
>>> web3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545", request_kwargs={'timeout': 60}))
228+
>>> w3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545", request_kwargs={'timeout': 60}))
229229
230230
231231
IPCProvider
@@ -241,7 +241,7 @@ IPCProvider
241241
.. code-block:: python
242242
243243
>>> from web3 import Web3
244-
>>> web3 = Web3(Web3.IPCProvider("~/Library/Ethereum/geth.ipc"))
244+
>>> w3 = Web3(Web3.IPCProvider("~/Library/Ethereum/geth.ipc"))
245245
246246
If no ``ipc_path`` is specified, it will use the first IPC file
247247
it can find from this list:
@@ -275,7 +275,7 @@ WebsocketProvider
275275
.. code-block:: python
276276
277277
>>> from web3 import Web3
278-
>>> web3 = Web3(Web3.WebsocketProvider("ws://127.0.0.1:8546"))
278+
>>> w3 = Web3(Web3.WebsocketProvider("ws://127.0.0.1:8546"))
279279
280280
Under the hood, the ``WebsocketProvider`` uses the python websockets library for
281281
making requests. If you would like to modify how requests are made, you can
@@ -286,7 +286,7 @@ WebsocketProvider
286286
.. code-block:: python
287287
288288
>>> from web3 import Web3
289-
>>> web3 = Web3(Web3.WebsocketProvider("http://127.0.0.1:8546", websocket_kwargs={'timeout': 60}))
289+
>>> w3 = Web3(Web3.WebsocketProvider("http://127.0.0.1:8546", websocket_kwargs={'timeout': 60}))
290290
291291
.. py:currentmodule:: web3.providers.eth_tester
292292
@@ -366,7 +366,7 @@ simply instantiate your web3 instance with an iterable of provider instances.
366366
>>> from . import MySpecialProvider
367367
>>> special_provider = MySpecialProvider()
368368
>>> infura_provider = HTTPProvider('https://ropsten.infura.io')
369-
>>> web3 = Web3([special_provider, infura_provider])
369+
>>> w3 = Web3([special_provider, infura_provider])
370370
371371
372372
When web3 has multiple providers it will iterate over them in order, trying the

0 commit comments

Comments
 (0)