Function definition Expr that prints incorrectly but evals correctly

The pretty printing seems broken to me, there is no reason it should insert a , after the inline comment block/LineNumberNode, thereby treating a comment as an argument. My guess is that the printing is a bit too naive here and doesn’t check whether the element in the list is actually an argument expression or not.

Of course, you could also just as well remove the LineNumberNode in your expansion.

1 Like