Dont understand the lambda in here() and root()
Hi , I have not used labmdas much and am a little confused by the lambdas for here and root .
The part that I am confused about is the * x in the lambda parameter definition
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(file)), *x)
What is does the * space x mean.
Sorry You must be a logged in, registered user to answer a question.
Answers
Sorry for pre-emptively asking the question. I tested it out and * space x means the same as *x which is a variable list of arguments like *args normally used in function definition examples
So the above lambda is the same as
here = lambda *x: os.path.join(os.path.abspath(os.path.dirname(file)), *x
Hari Jayaram
on