mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 00:10: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:
@@ -19,7 +19,6 @@ import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
from typing import List
|
||||
from .address import create_deterministic_address_bcrt1_p2tr_op_true
|
||||
from .authproxy import JSONRPCException
|
||||
from . import coverage
|
||||
@@ -96,7 +95,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method"""
|
||||
self.chain: str = 'regtest'
|
||||
self.setup_clean_chain: bool = False
|
||||
self.nodes: List[TestNode] = []
|
||||
self.nodes: list[TestNode] = []
|
||||
self.extra_args = None
|
||||
self.network_thread = None
|
||||
self.rpc_timeout = 60 # Wait for up to 60 seconds for the RPC server to respond
|
||||
|
||||
Reference in New Issue
Block a user