mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-02 16:59:44 +01:00
test: use built-in collection types for type hints (Python 3.9 / PEP 585)
Since Python 3.9, type hinting has become a little less awkward, as for
collection types one doesn't need to import the corresponding
capitalized types (`Dict`, `List`, `Set`, `Tuple`, ...) anymore, but can
use the built-in types directly. [1] [2]
This commit applies the replacement for all Python scripts (i.e. in the
contrib and test folders) for the basic types:
- typing.Dict -> dict
- typing.List -> list
- typing.Set -> set
- typing.Tuple -> tuple
[1] https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections
[2] https://peps.python.org/pep-0585/#implementation for a list of type
This commit is contained in:
@@ -9,7 +9,6 @@ from decimal import Decimal
|
||||
from enum import Enum
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
Optional,
|
||||
)
|
||||
from test_framework.address import (
|
||||
@@ -284,7 +283,7 @@ class MiniWallet:
|
||||
def create_self_transfer_multi(
|
||||
self,
|
||||
*,
|
||||
utxos_to_spend: Optional[List[dict]] = None,
|
||||
utxos_to_spend: Optional[list[dict]] = None,
|
||||
num_outputs=1,
|
||||
amount_per_output=0,
|
||||
locktime=0,
|
||||
|
||||
Reference in New Issue
Block a user