gh-79037: Add signature and body expression to the repr of lambda#9647
gh-79037: Add signature and body expression to the repr of lambda#9647serhiy-storchaka wants to merge 5 commits intopython:mainfrom
Conversation
| if (!exprstr) { | ||
| return 0; | ||
| } | ||
| name = PyUnicode_FromFormat("<%U>", exprstr); |
There was a problem hiding this comment.
Before this, add C equivalent of, say,
if len(exprstr) > 36: exprstr = exprstr[0:36] + ' ...'
There was a problem hiding this comment.
I think this will only add more confusion, especially if the lambda is the part of other object. Most lambda expressions are relatively short, and if they are long, many users would prefer the full expression with balanced quotes and parentheses. We already have such issue with truncated regular expressions.
iritkatriel
left a comment
There was a problem hiding this comment.
This has merge conflicts now.
|
When you're done making the requested changes, leave the comment: |
furkanonder
left a comment
There was a problem hiding this comment.
LGTM. It would be extremely beneficial for Lambda's repr to include the signature and body, particularly for debugging. @serhiy-storchaka Could you resolve the conflicts?
|
This PR is stale because it has been open for 30 days with no activity. |
|
Are you still working on this, I can fix the conflicts? |
|
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue34856