+ 1
tpl = () vs tpl = tuple()
What is the difference between tpl = () and tpl = tuple()
4 ответов
+ 3
tuple() is the constructor of type tuple, which creates... a tuple.
So for all practical purposes, there's no difference.
You'll mostly use tuple() whenever you want to convert a different type of iterable to a tuple.
+ 4
No differences
Two ways to create an empty tuple
+ 4
() is 8 times faster than tuple()
https://code.sololearn.com/c6yWVimHUYMX/?ref=app
+ 3
Nice shortcut. :)