![](https://secure.gravatar.com/avatar/4c01705256aa2160c1354790e8c154db.jpg?s=120&d=mm&r=g)
17.12.17 22:55, Terry Reedy пише:
What if include the signature and the expression of the lambda in its repr?
>>> lambda x: x**2 <lambda x: x**2>
Printing the return value requires adding a code or function attribute.
Yes, this requires adding an optional constant code attribute.
The return expression(s), possibly None, would be just as useful for named functions.
In case of named functions the body is not an expression and usually is multiline.
But there is a problem with default values. Their reprs can be very long, especially in the following case with mutable default value:
I would not expect the representation to change; just use the expression.
This is a solution, thanks.
Maybe the placeholder should be always used instead of default values.
Do you mean 'a placeholder'?
Yes, sorry.