There are two valid ways to declare an empty list with type hints.
-
numbers: list[int] = []
-
numbers = list[int]()
What is the better way of doing it?
submitted by /u/ViktorBatir
[link] [comments]
r/learnpython There are two valid ways to declare an empty list with type hints. numbers: list[int] = [] numbers = list[int]() What is the better way of doing it? submitted by /u/ViktorBatir [link] [comments]
There are two valid ways to declare an empty list with type hints.
-
numbers: list[int] = []
-
numbers = list[int]()
What is the better way of doing it?
submitted by /u/ViktorBatir
[link] [comments]