File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,29 @@ Each Contract Factory exposes the following properties.
146
146
The runtime part of the contract bytecode string. May be ``None `` if not
147
147
provided during factory creation.
148
148
149
+
150
+ .. py :attribute :: Contract.decode_tuples
151
+
152
+ If a Tuple/Struct is returned by a contract function, this flag defines whether
153
+ to apply the field names from the ABI to the returned data.
154
+ If False, the returned value will be a normal Python `Tuple `. If True, the returned
155
+ value will be a Python `NamedTuple ` of the name `ABIDecodedNamedTuple `.
156
+
157
+ NamedTuples have some restrictions regarding field names.
158
+ Web3.py sets `NamedTuple `'s `rename=True `, so disallowed field names my be
159
+ different than expected. See the [Python docs](https://docs.python.org/3/library/collections.html#collections.namedtuple)
160
+ for more information.
161
+
162
+ May be ``None `` if not provided during factory creation.
163
+
164
+
149
165
.. py :attribute :: Contract.functions
150
166
151
167
This provides access to contract functions as attributes. For example:
152
168
``myContract.functions.MyMethod() ``. The exposed contract functions are classes of the
153
169
type :py:class: `ContractFunction `.
154
170
171
+
155
172
.. py :attribute :: Contract.events
156
173
157
174
This provides access to contract events as attributes. For example:
Original file line number Diff line number Diff line change @@ -1446,6 +1446,7 @@ Contracts
1446
1446
- ``bytecode_runtime ``
1447
1447
- ``clone_bin ``
1448
1448
- ``dev_doc ``
1449
+ - ``decode_tuples ``
1449
1450
- ``interface ``
1450
1451
- ``metadata ``
1451
1452
- ``opcodes ``
You can’t perform that action at this time.
0 commit comments