Reputation: 87
Consider these two same function calls:
func(arg1, arg2, ...)
and
func(
arg1,
arg2,
...
)
Does a single line statement performs better than a multi-line one?
Upvotes: 0
Views: 100
Reputation: 530823
No. Both produce the same abstract syntax tree (AST) from which the Python byte code is produced. Only the parser ever sees a difference between the two.
(And yes, I am intentionally ignoring the time it takes the parser to iterate through the extra whitespace in the second example as negligible.)
Upvotes: 3