Skip to content

Commit 3858fd8

Browse files
committed
style: use list in type hints
1 parent 74a4fba commit 3858fd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

string_to_code/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import random
77
import functools
88

9-
Strings: typing.TypeAlias = typing.List[str]
9+
Strings: typing.TypeAlias = list[str]
1010

1111

1212
class Atom(typing.NamedTuple):
@@ -25,13 +25,13 @@ class SimpleFunction(typing.NamedTuple):
2525
other functions of such type or displaying single characters
2626
"""
2727

28-
called_list: typing.List[CalledListEntry]
28+
called_list: list[CalledListEntry]
2929

3030

31-
SimpleFunctions: typing.TypeAlias = typing.List[SimpleFunction]
31+
SimpleFunctions: typing.TypeAlias = list[SimpleFunction]
3232

3333

34-
def str_pieces(in_str: str, in_pieces_len: typing.List[int]) -> Strings:
34+
def str_pieces(in_str: str, in_pieces_len: list[int]) -> Strings:
3535
"""returns in_str split into pieces of lengths as in in_pieces_len"""
3636
assert all(_ > 0 for _ in in_pieces_len)
3737
assert sum(in_pieces_len) == len(in_str)
@@ -44,7 +44,7 @@ def str_pieces(in_str: str, in_pieces_len: typing.List[int]) -> Strings:
4444
return res
4545

4646

47-
def random_pieces_len(in_total_len: int) -> typing.List[int]:
47+
def random_pieces_len(in_total_len: int) -> list[int]:
4848
"""returns a list of positive numbers with their sum being in_total_len"""
4949
cur_num = in_total_len
5050
res = []

0 commit comments

Comments
 (0)