aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_rest.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-10-25 00:55:17 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-10-25 01:10:21 +0200
commitd516cf83ed2da86dfefb395cd46f8a894907b88e (patch)
treefc6f864676dc1820a705583c9f518b694dd8a635 /test/functional/interface_rest.py
parentd53400e75e2a4573229dba7f1a0da88eb936811c (diff)
downloadbitcoin-d516cf83ed2da86dfefb395cd46f8a894907b88e.tar.xz
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
Diffstat (limited to 'test/functional/interface_rest.py')
-rwxr-xr-xtest/functional/interface_rest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index c0679c5ba9..b81eae2506 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -65,7 +65,7 @@ class RESTTest (BitcoinTestFramework):
body: str = '',
status: int = 200,
ret_type: RetType = RetType.JSON,
- query_params: Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: Optional[dict[str, typing.Any]] = None,
) -> typing.Union[http.client.HTTPResponse, bytes, str, None]:
rest_uri = '/rest' + uri
if req_type in ReqType: