Has using 'thing = liststr' instead of 'thing: list[str] = []' any downsides?
InsecureSignpost @ InsecureSignpost @kbin.social Posts 0Comments 2Joined 2 yr. ago
InsecureSignpost @ InsecureSignpost @kbin.social
Posts
0
Comments
2
Joined
2 yr. ago
In addition to what others have said, collection literals are also faster.
list[str]()
performs a function call that technically might not be the built-inlist
. Where[]
is always an empty list and it can be created with less overhead.