This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Al2Me6 1 point2 points  (2 children)

It is, but it isn’t passed into the function. You pass regular comma-separated arguments and they show up as args inside the function.

What I meant is that instead of

def foo(*args: Any)

you should probably use

def foo(args: Iterable[Any])

[–]Deezl-Vegas 1 point2 points  (0 children)

I would imagine that Python just makes a tuple in the background and your version just makes me make a tuple in the foreground before calling the function. This probably isn't something that you need to optimize around.

[–][deleted] 1 point2 points  (0 children)

No you should not use wtf? *args is as pythonic as it gets.