From the docs
Due to an oversight, earlier Python versions erroneously accepted the following syntax:
f(1 for x in [1], *args)
f(1 for x in [1], **kwargs)
Python 3.5 now correctly raises a SyntaxError, as generator expressions must be put in parentheses if not a sole argument to a function.
What does that mean? Why is it that it's the wrong with the syntax above? Can someone show an example code of why is that a bad generator expression?
I think I understand it this much:
- there is a function
f()
- that takes a generator, args and kwargs as its parameter
But why is the args and the kwargs usage wrong?