Skip to content

Commit 5eb59be

Browse files
committed
refactor: use builtin generics for type hints in docstrings
Update type hints to use builtin generics (e.g., list, tuple) instead of capitalized versions (e.g., List, Tuple) in docstrings and return annotations. This improves consistency with modern Python typing conventions.
1 parent 0dee698 commit 5eb59be

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

cardano_clusterlib/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _prepend_flag(flag: str, contents: itp.UnpackableSequence) -> list[str]:
2828
contents: A list (iterable) of content to be prepended.
2929
3030
Returns:
31-
List[str]: A list of flag followed by content, see below.
31+
list[str]: A list of flag followed by content, see below.
3232
3333
>>> ClusterLib._prepend_flag(None, "--foo", [1, 2, 3])
3434
['--foo', '1', '--foo', '2', '--foo', '3']

cardano_clusterlib/query_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_utxo(
7878
coins: A list (iterable) of coin names (asset IDs, optional).
7979
8080
Returns:
81-
List[structs.UTXOData]: A list of UTxO data.
81+
list[structs.UTXOData]: A list of UTxO data.
8282
"""
8383
cli_args = ["utxo", "--output-json"]
8484

@@ -352,7 +352,7 @@ def get_leadership_schedule(
352352
epoch (current epoch by default)
353353
354354
Returns:
355-
List[structs.LeadershipSchedule]: A list of `structs.LeadershipSchedule`, specifying
355+
list[structs.LeadershipSchedule]: A list of `structs.LeadershipSchedule`, specifying
356356
slot and time.
357357
"""
358358
args = []

cardano_clusterlib/stake_pool_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def register_stake_pool(
261261
destination_dir: A path to directory for storing artifacts (optional).
262262
263263
Returns:
264-
Tuple[Path, structs.TxRawOutput]: A tuple with pool registration cert file and
264+
tuple[Path, structs.TxRawOutput]: A tuple with pool registration cert file and
265265
transaction output details.
266266
"""
267267
tx_name = f"{tx_name}_reg_pool"
@@ -316,7 +316,7 @@ def deregister_stake_pool(
316316
destination_dir: A path to directory for storing artifacts (optional).
317317
318318
Returns:
319-
Tuple[Path, structs.TxRawOutput]: A data container with pool registration cert file and
319+
tuple[Path, structs.TxRawOutput]: A data container with pool registration cert file and
320320
transaction output details.
321321
"""
322322
tx_name = f"{tx_name}_dereg_pool"

cardano_clusterlib/transaction_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ def calculate_plutus_script_cost(
18721872
destination_dir: A path to directory for storing artifacts (optional).
18731873
18741874
Returns:
1875-
List[dict]: A Plutus scripts cost data.
1875+
list[dict]: A Plutus scripts cost data.
18761876
"""
18771877
# Collect all arguments that will be passed to `build_tx`
18781878
kwargs = locals()

cardano_clusterlib/txtools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def _resolve_withdrawals(
374374
withdrawals: A list (iterable) of `TxOuts`, specifying reward withdrawals.
375375
376376
Returns:
377-
List[structs.TxOut]: A list of `TxOuts`, specifying resolved reward withdrawals.
377+
list[structs.TxOut]: A list of `TxOuts`, specifying resolved reward withdrawals.
378378
"""
379379
resolved_withdrawals = []
380380
for rec in withdrawals:
@@ -658,7 +658,7 @@ def _get_tx_ins_outs(
658658
(`build` command balance the assets automatically in newer versions).
659659
660660
Returns:
661-
Tuple[list, list]: A tuple of list of transaction inputs and list of transaction
661+
tuple[list, list]: A tuple of list of transaction inputs and list of transaction
662662
outputs.
663663
"""
664664
txouts_passed_db: dict[str, list[structs.TxOut]] = _organize_tx_ins_outs_by_coin(txouts)
@@ -863,7 +863,7 @@ def get_utxo(
863863
coins: A list (iterable) of coin names (asset IDs).
864864
865865
Returns:
866-
List[structs.UTXOData]: A list of UTxO data.
866+
list[structs.UTXOData]: A list of UTxO data.
867867
"""
868868
utxo = []
869869
for utxo_rec, utxo_data in utxo_dict.items():

0 commit comments

Comments
 (0)