Python Generic Question /u/ViktorBatir Python Education

There are two valid ways to declare an empty list with type hints.

  1. numbers: list[int] = []

  2. 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.

  1. numbers: list[int] = []

  2. numbers = list[int]()

What is the better way of doing it?

submitted by /u/ViktorBatir
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *