Skip to content

Commit 6ede775

Browse files
authored
Merge pull request #368 from vil02/do_not_use_typing_list
style: use `list` in type hints
2 parents 74a4fba + b3323d4 commit 6ede775

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "string-to-code"
3-
version = "0.2.13"
3+
version = "0.2.14"
44
description = "Generates a piece of messy code in a given language displaying a given string "
55
authors = ["piotr.idzik <[email protected]>"]
66
readme = "./string_to_code/README.md"

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)