Skip to content

Commit e4331ea

Browse files
wolovimfselmo
authored andcommitted
recorrect docs for external modules
1 parent 3bcf7de commit e4331ea

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/web3.main.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,13 @@ web3.py library.
419419
External Modules
420420
~~~~~~~~~~~~~~~~
421421

422-
External modules can be used to introduce custom or third-party APIs to your ``Web3`` instance. They are not required to
423-
utilize the parent ``Web3`` instance; if no reference is required, the external module need only be a standard class.
424-
If, however, you do want to reference the parent ``Web3`` object, the external module must inherit from the
425-
``web3.module.Module`` class and handle the instance as an argument within the ``__init__`` function:
422+
External modules can be used to introduce custom or third-party APIs to your ``Web3`` instance. External modules are simply
423+
classes whose methods and properties can be made available within the ``Web3`` instance. Optionally, the external module may
424+
make use of the parent ``Web3`` instance by accepting it as the first argument within the ``__init__`` function:
426425

427426
.. code-block:: python
428427
429-
>>> from web3.module import Module
430-
>>> class ExampleModule(Module):
428+
>>> class ExampleModule:
431429
... def __init__(self, w3):
432430
... self.w3 = w3
433431
...
@@ -439,7 +437,8 @@ If, however, you do want to reference the parent ``Web3`` object, the external m
439437
and open source code you've vetted!
440438

441439
Configuring external modules can occur either at instantiation of the ``Web3`` instance or by making use of the
442-
``attach_modules()`` method. To instantiate the ``Web3`` instance with external modules:
440+
``attach_modules()`` method. To instantiate the ``Web3`` instance with external modules use the ``external_modules``
441+
keyword argument:
443442

444443
.. code-block:: python
445444

0 commit comments

Comments
 (0)